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

Function tokenBefore

src/resolution/frameworks/react.ts:1091–1095  ·  view source on GitHub ↗
(at: number)

Source from the content-addressed store, hash-verified

1089 // The few characters before `at`, trailing whitespace skipped: enough for the
1090 // end-anchored checks below without copying the whole prefix per `/` or `<`.
1091 const tokenBefore = (at: number): string => {
1092 let j = at - 1;
1093 while (j >= 0 && /\s/.test(source[j]!)) j--;
1094 return source.slice(Math.max(0, j - 11), j + 1);
1095 };
1096 const trivia = (at: number): number => {
1097 while (at < source.length) {
1098 if (/\s/.test(source[at]!)) { at++; continue; }

Callers 1

unitFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected