Expand description
Literal-search check for the consumers of an export.
An agent finds the users of an export with a whole-word text search for its name. The module graph knows every consumer, also the consumers that such a search does not find: a default import under another name, a barrel alias, a whole-namespace use. This module reads consumer sources on demand, only for the exports that a caller checks, and compares the graph edge with what the text search sees.
Structs§
- Export
Declaration - The top-level statement that declares one export.
- Search
Check - The result of the literal-search check for one consumer.
Functions§
- contains_
whole_ word - Whether
sourcecontainswordas a whole-word token, asgrep -wsees it. Matches in comments and strings count, because a text search finds them too. - declaration_
line_ ranges - The 1-based line range of the top-level statement that declares each export of a source file, keyed by the byte offset of the export span.
- default_
declaration_ name - The declaration name of a default export whose source starts at
start. - export_
declarations - The declaring statement of each export of a source file, keyed by the
byte offset of the export span. One parse gives the line range and the
literal-initializer flag. See
declaration_line_rangesfor the mapping rules.