BaseReporter
Direct Subclass:
Constructor Summary
Public Constructor | ||
public |
constructor(inspector: Inspector, opts: object) A base reporter from which all others inherit. |
Method Summary
Private Methods | ||
private |
_getAbsolutePath(filePath: string): string Returns the absolute path for a file. |
|
private |
_getFormattedLocation(instance: Object): string Returns a string containing the path to the file in which the nodes are located, as well as the lines on which the nodes exist. |
|
private |
Returns the lines associated with an instance. |
|
private |
_getRelativePath(filePath: string): string Returns the relative path for a file. |
|
private |
Registers a listener to the "match" event exposed by the Inspector instance. |
|
private |
Registers a listener that prints a final summary outlining the number of matches detected, as well as the number of files analyzed. |
Public Constructors
Private Methods
private _getAbsolutePath(filePath: string): string source
Returns the absolute path for a file.
Params:
Name | Type | Attribute | Description |
filePath | string |
private _getFormattedLocation(instance: Object): string source
Returns a string containing the path to the file in which the nodes are located, as well as the lines on which the nodes exist.
Params:
Name | Type | Attribute | Description |
instance | Object |
private _getLines(instance: Object): string source
Returns the lines associated with an instance.
Params:
Name | Type | Attribute | Description |
instance | Object |
private _getRelativePath(filePath: string): string source
Returns the relative path for a file.
Params:
Name | Type | Attribute | Description |
filePath | string |
private _registerListener() source
Registers a listener to the "match" event exposed by the Inspector instance. Increments _found for each match emitted, and invokes the object's _getOutput method, writing it to stdout.
private _registerSummary() source
Registers a listener that prints a final summary outlining the number of matches detected, as well as the number of files analyzed.