Files
reverse-engineering-anything/scripts/lib/import-specifiers.d.mts
T
morlutoandCursor Agent 249b90c5e3 refactor(javascript): break the semantic analysis import cycle (#8063)
* refactor(javascript): break the semantic analysis import cycle

Split shared semantic facts out of the analysis hub so projectors of
effects, evaluation, and identity no longer import one another in a cycle.

* refactor(javascript): share the import specifier reader

Read static imports in one module used by the boundary checker and both
cycle guards, so those rules cannot drift apart.

---------

Co-authored-by: Cursor Agent <cursoragent@cursor.com>
2026-10-30 06:07:49 +08:00

19 lines
544 B
TypeScript

/** One static import or re-export specifier and its source line. */
export interface ImportSpecifierFact {
readonly specifier: string;
readonly line: number;
}
/** Static string specifier on one import or re-export node, when it has one. */
export function importSpecifier(node: {
readonly type: string;
}): string | undefined;
/**
* Static import and re-export specifiers in source order.
* Comments and string literals are not imports.
*/
export function readImportSpecifiers(
source: string,
): readonly ImportSpecifierFact[];