JsSource

io.shiftleft.js2cpg.parser.JsSource
See theJsSource companion object
class JsSource(val srcDir: File, val projectDir: Path, val source: Source)

Attributes

Companion
object
Graph
Supertypes
class Object
trait Matchable
class Any

Members list

Value members

Concrete methods

def filePath: String

Attributes

Returns

the file path of the parsed file. If this file is the result of transpilation the original source file path is calculated from the corresponding sourcemap.

def getCode(node: Node): String

Attributes

Returns

the code of a node in the parsed file. If this file is the result of transpilation the original code is calculated from the corresponding sourcemap. Note: in this case, only the re-mapped starting line/column number are available. Hence, we extract only a fixed number of characters (max. until the end of the file).

def getColumn(node: Node): Option[Int]

Attributes

Returns

the column number of a node in the parsed file. If this file is the result of transpilation the original column number is calculated from the corresponding sourcemap.

def getLine(node: Node): Option[Int]

Attributes

Returns

the line number of a node in the parsed file. If this file is the result of transpilation the original line number is calculated from the corresponding sourcemap.

def getString(node: Node): String
def originalFilePath: String

Attributes

Returns

always the original file that was parsed. Might be a file that is the result of transpilation

Concrete fields

val projectDir: Path
val source: Source
val srcDir: File