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

Function labelAt

__tests__/branch-guards.test.ts:22–26  ·  view source on GitHub ↗
(src: string, needle: string, language: 'tsx' | 'typescript' | 'swift' = 'tsx')

Source from the content-addressed store, hash-verified

20}
21
22async function labelAt(src: string, needle: string, language: 'tsx' | 'typescript' | 'swift' = 'tsx') {
23 const line = lineOf(src, needle);
24 const column = src.split('\n')[line - 1]!.indexOf(needle);
25 return guardLabel(await guardsInSource(src, language, line, column));
26}
27
28describe('branch guards: JS/TS', () => {
29 const handlePress = `

Callers 1

Calls 3

guardLabelFunction · 0.90
guardsInSourceFunction · 0.90
lineOfFunction · 0.70

Tested by

no test coverage detected