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

Function getStaticImportPath

src/extraction/languages/nix.ts:38–56  ·  view source on GitHub ↗
(argNode: SyntaxNode, source: string)

Source from the content-addressed store, hash-verified

36}
37
38function getStaticImportPath(argNode: SyntaxNode, source: string): string | null {
39 let current = argNode;
40 while (current.type === 'parenthesized_expression') {
41 const inner = current.namedChild(0);
42 if (!inner) break;
43 current = inner;
44 }
45
46 let text = getNodeText(current, source).trim();
47 if (
48 ((text.startsWith('"') && text.endsWith('"')) ||
49 (text.startsWith("'") && text.endsWith("'"))) &&
50 text.length >= 2
51 ) {
52 text = text.slice(1, -1);
53 }
54
55 return isStaticProjectPath(text) ? text : null;
56}
57
58function isReturnedAttrsetMember(node: SyntaxNode): boolean {
59 let current: SyntaxNode | null = node;

Callers 1

nix.tsFile · 0.85

Calls 2

getNodeTextFunction · 0.90
isStaticProjectPathFunction · 0.85

Tested by

no test coverage detected