MCPcopy Create free account
hub / github.com/UsefulSoftwareCo/executor / readQuoted

Function readQuoted

packages/core/sdk/src/www-authenticate.ts:48–66  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

46 };
47 // Returns null on an unterminated quote or a quote run into the next token.
48 const readQuoted = (): string | null => {
49 let value = "";
50 i += 1; // opening quote
51 while (i < len) {
52 const ch = header[i]!;
53 if (ch === '"') {
54 i += 1;
55 return i >= len || /[\s,]/.test(header[i]!) ? value : null;
56 }
57 if (ch === "\\" && i + 1 < len) {
58 value += header[i + 1];
59 i += 2;
60 continue;
61 }
62 value += ch;
63 i += 1;
64 }
65 return null; // unterminated
66 };
67
68 while (i < len) {
69 while (i < len && /\s/.test(header[i]!)) i += 1;

Callers 1

parseChallengesFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected