import AbstractFormatText from 'typhonjs-escomplex-commons/src/transform/formats/text/AbstractFormatText.js'
AbstractFormatText
Direct Subclass:
Indirect Subclass:
Provides the base text format transform for ModuleReport / ProjectReport instances.
Constructor Summary
Public Constructor | ||
public |
constructor(headers: object, keys: object) Initializes instance storing default headers / keys. |
Method Summary
Public Methods | ||
public |
formatReport(report: ClassReport | MethodReport | ModuleReport | ProjectReport, options: object): string Formats a report as plain text. |
Protected Methods | ||
protected |
_formatProject(projectReport: ProjectReport, options: object): string Formats a project report as plain text. |
Private Methods | ||
private |
_formatClass(classReport: ClassReport, options: object, prepend: string): string Formats a class report. |
|
private |
_formatClasses(classReports: Array<ClassReport>, options: object, prepend: string): string Formats a module reports methods array. |
|
private |
_formatEntries(report: object, entries: Array<string> | Array<string | StringUtil.SafeEntry>, prepend: string, parentPrepend: string): string | Array<string> Formats entries for a given report based on an array of accessor entries. |
|
private |
_formatMethod(methodReport: MethodReport, options: object, prepend: string, isModule: boolean): string Formats a method report. |
|
private |
_formatMethods(methodReports: Array<ClassMethodReport | ClassMethodReport>, options: object, prepend: string, isModule: boolean): string Formats a module reports methods array. |
|
private |
_formatModule(report: ModuleReport, options: object): string Formats a module report as plain text. |
|
private |
_formatModuleReport(moduleReport: ModuleReport, reportsAvailable: boolean, options: object): string Formats a module report. |
|
private |
_formatProjectReport(projectReport: ProjectReport, options: object): string Formats a project report. |
Public Constructors
Public Methods
public formatReport(report: ClassReport | MethodReport | ModuleReport | ProjectReport, options: object): string source
Formats a report as plain text.
Params:
Name | Type | Attribute | Description |
report | ClassReport | MethodReport | ModuleReport | ProjectReport | A report to format. |
|
options | object | (Optional) One or more optional parameters passed to the formatter. |
Protected Methods
protected _formatProject(projectReport: ProjectReport, options: object): string source
Formats a project report as plain text.
Params:
Name | Type | Attribute | Description |
projectReport | ProjectReport | A project report. |
|
options | object | (Optional) One or more optional parameters passed to the formatter. |
Private Methods
private _formatClass(classReport: ClassReport, options: object, prepend: string): string source
Formats a class report.
Params:
Name | Type | Attribute | Description |
classReport | ClassReport | A class report. |
|
options | object | (Optional) One or more optional parameters passed to the formatter. |
|
prepend | string | (Optional) A string to prepend; default: |
private _formatClasses(classReports: Array<ClassReport>, options: object, prepend: string): string source
Formats a module reports methods array.
Params:
Name | Type | Attribute | Description |
classReports | Array<ClassReport> | An array of ClassReport instances to format. |
|
options | object | (Optional) One or more optional parameters passed to the formatter. |
|
prepend | string | (Optional) A string to prepend; default: |
private _formatEntries(report: object, entries: Array<string> | Array<string | StringUtil.SafeEntry>, prepend: string, parentPrepend: string): string | Array<string> source
Formats entries for a given report based on an array of accessor entries.
Params:
Name | Type | Attribute | Description |
report | object | A class / method report. |
|
entries | Array<string> | Array<string | StringUtil.SafeEntry> | (Optional) One or more optional entries to format. |
|
prepend | string | (Optional) A string to prepend; default: |
|
parentPrepend | string | (Optional) The parent prepend string used for entries that are arrays with
more than one entry; default: |
private _formatMethod(methodReport: MethodReport, options: object, prepend: string, isModule: boolean): string source
Formats a method report.
Params:
Name | Type | Attribute | Description |
methodReport | MethodReport | A method report. |
|
options | object | (Optional) One or more optional parameters passed to the formatter. |
|
prepend | string | (Optional) A string to prepend; default: |
|
isModule | boolean | (Optional) Indicates module scope; default: |
private _formatMethods(methodReports: Array<ClassMethodReport | ClassMethodReport>, options: object, prepend: string, isModule: boolean): string source
Formats a module reports methods array.
Params:
Name | Type | Attribute | Description |
methodReports | Array<ClassMethodReport | ClassMethodReport> | An array of method report instances to format. |
|
options | object | (Optional) One or more optional parameters passed to the formatter. |
|
prepend | string | (Optional) A string to prepend; default: |
|
isModule | boolean | (Optional) Indicates module scope; default: |
private _formatModule(report: ModuleReport, options: object): string source
Formats a module report as plain text.
Params:
Name | Type | Attribute | Description |
report | ModuleReport | A module report. |
|
options | object | (Optional) One or more optional parameters passed to the formatter. |
private _formatModuleReport(moduleReport: ModuleReport, reportsAvailable: boolean, options: object): string source
Formats a module report.
Params:
Name | Type | Attribute | Description |
moduleReport | ModuleReport | A module report. |
|
reportsAvailable | boolean | Indicates that the report metric data is available. |
|
options | object | (Optional) One or more optional parameters passed to the formatter. |
private _formatProjectReport(projectReport: ProjectReport, options: object): string source
Formats a project report.
Params:
Name | Type | Attribute | Description |
projectReport | ProjectReport | A project report. |
|
options | object | (Optional) One or more optional parameters passed to the formatter. |