0.4.0 • Published 9 years ago
stack-frame-utils v0.4.0
stack-frame-utils
Utilities for working with stack frames.
API
getLinesAround
Parameters
linenumber The line number to provide context around.countnumber The number of lines you'd like for context.lines(Array<string> | string) The source code.
Returns Array<ScriptLine>
getSourceMap
Returns an instance of SourceMap for a given fileUri and fileContents.
Parameters
SourceMap
A wrapped instance of a SourceMapConsumer.
This exposes methods which will be indifferent to changes made in source-map.
getOriginalPosition
Returns the original code position for a generated code position.
Parameters
linenumber The line of the generated code position.columnnumber The column of the generated code position.
Returns {source: string, line: number, column: number}
getGeneratedPosition
Returns the generated code position for an original position.
Parameters
sourcestring The source file of the original code position.linenumber The line of the original code position.columnnumber The column of the original code position.
Returns {line: number, column: number}
getSource
Returns the code for a given source file name.
Parameters
sourceNamestring The name of the source file.
Returns string