Skip to content

@saflib/parser


Function: extractImports()

extractImports(source): ImportEntry[]

Extract static import declarations from TypeScript/JavaScript source using the syntactic parser only (no type-checker).

Covers import … from "…", import "…", and export … from "…" (re-export as an inbound edge). Skips dynamic import().

Parameters

ParameterType
sourcestring

Returns

ImportEntry[]