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

Method importSource

src/extraction/tree-sitter.ts:970–974  ·  view source on GitHub ↗

* The text an import node reads its statement from: for a re-export, the * source as written when the extractor asks (`reExportAsWritten`), so * `export type * from './x'` keeps its `type` (#2474).

(node: SyntaxNode)

Source from the content-addressed store, hash-verified

968 * `export type * from './x'` keeps its `type` (#2474).
969 */
970 private importSource(node: SyntaxNode): string {
971 if (node.type !== 'export_statement' || this.sourceAsWritten === null) return this.source;
972 this.reExportsAsWritten ??= this.extractor?.reExportAsWritten?.(this.sourceAsWritten) === true;
973 return this.reExportsAsWritten ? this.sourceAsWritten : this.source;
974 }
975
976 /**
977 * Parse and extract from the source code

Callers 1

extractImportMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected