Skip to content

Commit ebc7af2

Browse files
committed
anchor the regex
1 parent 3e1b86c commit ebc7af2

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

packages/cloudflare/src/cli/build/patches/plugins/route-module.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -47,15 +47,15 @@ export function patchRouteModules(updater: ContentUpdater, buildOpts: BuildOptio
4747
export function getIncrementalCacheRule(handlerPath: string) {
4848
return `
4949
rule:
50-
pattern: "let $A, { cacheHandler: $B } = $C"
50+
pattern: "let $CACHE_HANDLER, { cacheHandler: $HANDLER_PATH } = $C"
5151
inside:
5252
kind: method_definition
5353
has:
5454
field: name
55-
regex: getIncrementalCache
55+
regex: ^getIncrementalCache$
5656
stopBy: end
5757
fix: |-
58-
const $B = null;
59-
$A = require('${normalizePath(handlerPath)}').default;
58+
const $HANDLER_PATH = null;
59+
$CACHE_HANDLER = require('${normalizePath(handlerPath)}').default;
6060
`;
6161
}

0 commit comments

Comments
 (0)