MCPcopy Create free account
hub / github.com/backnotprop/plannotator / parsePatchPathToken

Function parsePatchPathToken

packages/shared/diff-paths.ts:30–36  ·  view source on GitHub ↗
(token: string, side: "a" | "b")

Source from the content-addressed store, hash-verified

28}
29
30export function parsePatchPathToken(token: string, side: "a" | "b"): string | null {
31 const pathToken = stripUnquotedPathMetadata(token);
32 if (pathToken === "/dev/null") return "/dev/null";
33 const unquoted = unquoteGitPath(pathToken);
34 const prefix = `${side}/`;
35 return unquoted.startsWith(prefix) ? unquoted.slice(prefix.length) : null;
36}
37
38function scanHeaderToken(input: string): { token: string; rest: string } | null {
39 const trimmed = input.trimStart();

Callers 4

rewritePatchLineFunction · 0.90
diff-paths.test.tsFile · 0.90
parseDiffGitHeaderFunction · 0.85
parseDiffFilePathLinesFunction · 0.85

Calls 2

unquoteGitPathFunction · 0.85

Tested by

no test coverage detected