pub struct RequireCallInfo {
pub source: String,
pub span: Span,
pub source_span: Span,
pub destructured_names: Vec<String>,
pub destructured_locals: Vec<(String, String)>,
pub local_name: Option<String>,
pub is_type_only: bool,
}Expand description
A require() call.
Fields§
§source: StringThe require specifier.
span: SpanSource span of the require() call.
source_span: SpanSpan of the string-literal argument with quotes ('./x'), which anchors an
unresolved-import diagnostic. Span::default() for a non-literal argument.
destructured_names: Vec<String>Names destructured from the require() result.
destructured_locals: Vec<(String, String)>The (key, local) pair of each destructured identifier property:
const { exec: run } = require(...) gives ("exec", "run").
local_name: Option<String>The local variable name for const x = require(...).
is_type_only: booltrue for import type X = require('...'), the one require spelling
TypeScript erases entirely: the emitted JavaScript contains no
require call, so the target is a type-space reference and never a
runtime dependency. Always false for const x = require(...), which
has no type-only spelling. Read by dependency classification so a
type-only devDependency is not reported as production usage.