Skip to main content

Module search_visibility

Module search_visibility 

Source
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§

ExportDeclaration
The top-level statement that declares one export.
SearchCheck
The result of the literal-search check for one consumer.

Functions§

contains_whole_word
Whether source contains word as a whole-word token, as grep -w sees 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_ranges for the mapping rules.