diff options
Diffstat (limited to 'js/src/tool/grep.ts')
| -rw-r--r-- | js/src/tool/grep.ts | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/js/src/tool/grep.ts b/js/src/tool/grep.ts index 9c3754ce9..b67a4790e 100644 --- a/js/src/tool/grep.ts +++ b/js/src/tool/grep.ts @@ -274,7 +274,7 @@ export const grep = Tool.define({ 'File pattern to include in the search (e.g. "*.js", "*.{ts,tsx}")', ) .optional(), - literal_text: z + literalText: z .boolean() .describe( "If true, the pattern will be treated as literal text with special regex characters escaped. Default is false.", @@ -289,8 +289,8 @@ export const grep = Tool.define({ const app = await App.use(); const searchPath = params.path || app.root; - // If literal_text is true, escape the pattern - const searchPattern = params.literal_text + // If literalText is true, escape the pattern + const searchPattern = params.literalText ? escapeRegexPattern(params.pattern) : params.pattern; |
