@@ -14,12 +14,13 @@ rule:
1414 kind: if_statement
1515 stopBy: end
1616 has:
17- kind: parenthesized_expression
18- has: { kind: property_identifier , stopBy: end, regex: trustHostHeader}
17+ field: condition
18+ stopBy: end
19+ pattern: $$$_.trustHostHeader
1920 has:
2021 kind: call_expression
2122 all:
22- - has: {kind: identifier, pattern: fetch}
23+ - has: { kind: identifier, pattern: fetch}
2324 - has:
2425 kind: arguments
2526 all:
@@ -29,31 +30,23 @@ rule:
2930 - has:
3031 kind: pair
3132 all:
32- - has: {kind: property_identifier, regex: method }
33- - has: {kind: string, regex: 'HEAD'}
33+ - has: { kind: property_identifier, regex: method }
34+ - has: { kind: string, regex: 'HEAD'}
3435 - has:
3536 kind: pair
3637 all:
37- - has: {kind: property_identifier, regex: headers}
38- - has: {kind: identifier, pattern: $HEADERS}
38+ - has: { kind: property_identifier, regex: headers}
39+ - has: { kind: identifier, pattern: $HEADERS}
3940 - has:
4041 kind: template_string
4142 all:
42- - has:
43- kind: string_fragment
44- regex: https://
43+ - has: { kind: string_fragment, regex: ^https://$ }
4544 - has:
4645 kind: template_substitution
4746 all:
4847 - has: { kind: identifier, stopBy: end, pattern: $REQ }
49- - has:
50- kind: property_identifier
51- regex: headers
52- stopBy: end
53- - has:
54- kind: property_identifier
55- regex: host
56- stopBy: end
48+ - has: { kind: property_identifier, regex: ^headers$, stopBy: end }
49+ - has: { kind: property_identifier, regex: ^host$, stopBy: end }
5750 - has:
5851 kind: template_substitution
5952 pattern: $URL_PATH
@@ -69,7 +62,7 @@ export const patchResRevalidate: CodePatcher = {
6962 {
7063 versions : ">=14.2.0" ,
7164 pathFilter : getCrossPlatformPathRegex (
72- String . raw `(pages-api\.runtime\.prod\.js|node/api-resolver\.js)$` ,
65+ String . raw `(pages-api(?:-turbo)? \.runtime\.prod\.js|node/api-resolver\.js)$` ,
7366 {
7467 escape : false ,
7568 }
0 commit comments