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

Function readModuleAttr

src/resolution/frameworks/terraform.ts:220–222  ·  view source on GitHub ↗

* A direct string-literal attribute (`source = "…"`, `component = "…"`) of a * module declaration, re-read from its file (project paths are stored * relative; node metadata isn't persisted, so the declaration's line span + * cached file lines are the durable carrier). Non-literal values (variable

(decl: Node, name: string, context: ResolutionContext)

Source from the content-addressed store, hash-verified

218 * expressions) return null — dynamic wiring is never guessed.
219 */
220function readModuleAttr(decl: Node, name: string, context: ResolutionContext): string | null {
221 return readNodeSpanMatch(decl, new RegExp(`^\\s*${name}\\s*=\\s*"([^"]+)"`), context);
222}
223
224/** First capture of `re` across the node's line span, or null. */
225function readNodeSpanMatch(node: Node, re: RegExp, context: ResolutionContext): string | null {

Callers 1

resolveScopedModuleRefFunction · 0.85

Calls 1

readNodeSpanMatchFunction · 0.85

Tested by

no test coverage detected