MCPcopy Create free account
hub / github.com/kpdecker/jsdiff / unquoteIfQuoted

Function unquoteIfQuoted

src/patch/parse.ts:340–348  ·  view source on GitHub ↗

* If `s` starts with a double quote, unquotes it using C-style escape * rules (as used by Git). Otherwise returns `s` as-is.

(s: string)

Source from the content-addressed store, hash-verified

338 * rules (as used by Git). Otherwise returns `s` as-is.
339 */
340 function unquoteIfQuoted(s: string): string {
341 if (s.startsWith('"')) {
342 const parsed = parseQuotedFileName(s);
343 if (parsed) {
344 return parsed.fileName;
345 }
346 }
347 return s;
348 }
349
350 /**
351 * Parses a C-style quoted filename as used by Git or GNU `diff -u`.

Callers 2

parseIndexFunction · 0.85
parseFileHeaderFunction · 0.85

Calls 1

parseQuotedFileNameFunction · 0.85

Tested by

no test coverage detected