MCPcopy Create free account
hub / github.com/Zoo-Code-Org/Zoo-Code / whitespacePatternForRun

Function whitespacePatternForRun

src/core/tools/EditFileTool.ts:94–104  ·  view source on GitHub ↗
(run: string)

Source from the content-addressed store, hash-verified

92
93 const parts = oldLF.match(/(\s+|\S+)/g) ?? []
94 const whitespacePatternForRun = (run: string): string => {
95 // If the whitespace run includes a newline, allow matching any whitespace (including newlines)
96 // to tolerate wrapping changes across lines.
97 if (run.includes("\n")) {
98 return "\\s+"
99 }
100
101 // Otherwise, limit matching to horizontal whitespace so we don't accidentally consume
102 // line breaks that precede indentation.
103 return "[\\t ]+"
104 }
105
106 const pattern = parts
107 .map((part) => {

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected