SourceMap
[<Interface>]
type SourceMap =
abstract member payload: SourceMapPayload
static member Create (payload: SourceMapPayload, findEntry: Func<float,float,obj>, findOrigin: Func<float,float,obj>) : SourceMap
abstract member findEntry (lineOffset: float, columnOffset: float) : obj
abstract member findOrigin (lineNumber: float, columnNumber: float) : obj| Assembly | Xantham.Fable.Node |
| Attributes | [<Interface>] |
@since v13.7.0, v12.17.0
Properties
abstract member payload: SourceMapPayload
abstract member payload: SourceMapPayloadGetter for the payload used to construct the SourceMap instance.
Methods
static member Create (payload: SourceMapPayload, findEntry: Func<float,float,obj>, findOrigin: Func<float,float,obj>) : SourceMapabstract member findEntry (lineOffset: float, columnOffset: float) : obj
abstract member findEntry (lineOffset: float, columnOffset: float) : objGiven a line offset and column offset in the generated source file, returns an object representing the SourceMap range in the original file if found, or an empty object if not.
The object returned contains the following keys:
The returned value represents the raw range as it appears in the SourceMap, based on zero-indexed offsets, not 1-indexed line and column numbers as they appear in Error messages and CallSite objects.
To get the corresponding 1-indexed line and column numbers from a lineNumber and columnNumber as they are reported by Error stacks and CallSite objects, use sourceMap.findOrigin(lineNumber, columnNumber)
| Parameter | |
|---|---|
lineOffset | The zero-indexed line number offset in the generated source |
columnOffset | The zero-indexed column number offset in the generated source |
abstract member findOrigin (lineNumber: float, columnNumber: float) : obj
abstract member findOrigin (lineNumber: float, columnNumber: float) : objGiven a 1-indexed lineNumber and columnNumber from a call site in the generated source, find the corresponding call site location in the original source.
If the lineNumber and columnNumber provided are not found in any source map, then an empty object is returned.
| Parameter | |
|---|---|
lineNumber | The 1-indexed line number of the call site in the generated source |
columnNumber | The 1-indexed column number of the call site in the generated source |