MCPcopy Create free account
hub / github.com/colbymchenry/codegraph / string

Function string

src/resolution/import-resolver.ts:963–978  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

961 let i = at.index + at[0].length;
962 /** The string that starts at `i`, leaving `i` past it; null where there is none on that line. */
963 const string = (): string | null => {
964 const quote = body[i];
965 if ((quote !== '"' && quote !== "'") || body.startsWith(quote.repeat(3), i)) return null;
966 let value = '';
967 for (i++; i < body.length; i++) {
968 const ch = body[i]!;
969 if (ch === quote) {
970 i++;
971 return value;
972 }
973 if (ch === '\n' || ch === '\r') return null;
974 // A basic string escapes a backslash or a quote; a literal one escapes nothing.
975 value += ch === '\\' && quote === '"' ? body[++i] ?? '' : ch;
976 }
977 return null;
978 };
979 if (body[i] !== '[') {
980 const one = splitString ? string() : null;
981 return one === null ? [] : one.split(/\s+/).filter(Boolean);

Callers 1

tomlPathListFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected