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

Function inText

__tests__/strip-comments.test.ts:157–160  ·  view source on GitHub ↗

Whether the first `marker` in `src` is template text; null when the scan gives up.

(src: string, marker: string)

Source from the content-addressed store, hash-verified

155describe('templateLiteralTextAt', () => {
156 /** Whether the first `marker` in `src` is template text; null when the scan gives up. */
157 function inText(src: string, marker: string): boolean | null {
158 const at = templateLiteralTextAt(src);
159 return at === null ? null : at(src.indexOf(marker));
160 }
161
162 it('tells a template text from the code around it and in its interpolations', () => {
163 const src = 'const a = `TEXT ${CODE} MORE`;\nAFTER';

Callers 1

Calls 2

templateLiteralTextAtFunction · 0.90
atFunction · 0.70

Tested by

no test coverage detected