MCPcopy Index your code
hub / github.com/codeaashu/claude-code / desanitizeMatchString

Function desanitizeMatchString

src/tools/FileEditTool/utils.ts:557–574  ·  view source on GitHub ↗

* Normalizes a match string by applying specific replacements * This helps handle when exact matches fail due to formatting differences * @returns The normalized string and which replacements were applied

(matchString: string)

Source from the content-addressed store, hash-verified

555 * @returns The normalized string and which replacements were applied
556 */
557function desanitizeMatchString(matchString: string): {
558 result: string
559 appliedReplacements: Array<{ from: string; to: string }>
560} {
561 let result = matchString
562 const appliedReplacements: Array<{ from: string; to: string }> = []
563
564 for (const [from, to] of Object.entries(DESANITIZATIONS)) {
565 const beforeReplace = result
566 result = result.replaceAll(from, to)
567
568 if (beforeReplace !== result) {
569 appliedReplacements.push({ from, to })
570 }
571 }
572
573 return { result, appliedReplacements }
574}
575
576/**
577 * Normalize the input for the FileEditTool

Callers 1

normalizeFileEditInputFunction · 0.85

Calls 2

entriesMethod · 0.80
pushMethod · 0.45

Tested by

no test coverage detected