Skip to content

[F] getSourceLocation

function getSourceLocation(target, options?): SourceLocation;

Resolve a diagnostic target’s source range, using a synthetic location when no bound source exists.

ParameterType
targetDiagnosticTarget
options?SourceLocationOptions

SourceLocation

function getSourceLocation(target, options?): undefined;

Return no location for an absent target or the explicit NoTarget sentinel.

ParameterType
targettypeof NoTarget | undefined
options?SourceLocationOptions

undefined

function getSourceLocation(target, options?): SourceLocation | undefined;

Resolve an optional diagnostic target, returning undefined only when there is no target.

ParameterType
target| DiagnosticTarget | typeof NoTarget | undefined
options?SourceLocationOptions

SourceLocation | undefined