Match
Constructor Summary
Public Constructor | ||
public |
constructor(nodeArrays: Node[][]) Creates a new Match. |
Method Summary
Public Methods | ||
public |
populateLines(fileContents: object) Populates each match instance with a lines property containing the relevant source code lines. |
Private Methods | ||
private |
_generateInstances(nodeArrays: Node[][]): object Returns an array of objects containing the filename, start, end, and lines associated with all instances of a match. |
|
private |
Generates a hash for a match. |
Public Constructors
public constructor(nodeArrays: Node[][]) source
Creates a new Match.
Params:
Name | Type | Attribute | Description |
nodeArrays | Node[][] | Multi-dimensional array of nodes |
Public Methods
public populateLines(fileContents: object) source
Populates each match instance with a lines property containing the relevant source code lines.
Params:
Name | Type | Attribute | Description |
fileContents | object | The file paths and their contents |
Private Methods
private _generateInstances(nodeArrays: Node[][]): object source
Returns an array of objects containing the filename, start, end, and lines associated with all instances of a match. Due to sibling traversal, the end line must be searched for among the nodes, and isn't always defined by the last node in the array.
Params:
Name | Type | Attribute | Description |
nodeArrays | Node[][] | Multi-dimensional array of nodes |