MCPcopy Index your code
hub / github.com/kpdecker/jsdiff / needsQuoting

Function needsQuoting

src/patch/create.ts:8–15  ·  view source on GitHub ↗

* Returns true if the filename contains characters that require C-style * quoting (as used by Git and GNU diffutils in diff output).

(s: string)

Source from the content-addressed store, hash-verified

6 * quoting (as used by Git and GNU diffutils in diff output).
7 */
8function needsQuoting(s: string): boolean {
9 for (let i = 0; i < s.length; i++) {
10 if (s[i] < '\x20' || s[i] > '\x7e' || s[i] === '"' || s[i] === '\\') {
11 return true;
12 }
13 }
14 return false;
15}
16
17/**
18 * C-style quotes a filename, encoding special characters as escape sequences

Callers 1

quoteFileNameIfNeededFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected