import FormatJSONMinimal from 'typhonjs-escomplex-commons/src/transform/formats/json/FormatJSONMinimal.js'
FormatJSONMinimal
Provides a format transform for ESComplex ModuleReport / ProjectReport instances converting them to JSON with minimal metrics.
Constructor Summary
Public Constructor | ||
public |
constructor(keys: *) |
Member Summary
Public Members | ||
public get |
Gets the file extension. |
|
public get |
Gets the format name. |
|
public get |
Gets the format type. |
Private Members | ||
private |
_keys: * |
Method Summary
Public Methods | ||
public |
formatReport(report: ClassReport | MethodReport | ModuleReport | ProjectReport, options: object): string Formats a report as a JSON string with minimal metrics. |
|
public |
isSupported(reportType: ReportType): boolean Returns whether a given ReportType is supported by this format transform. |
Private Methods | ||
private |
_formatClass(classReport: ClassReport, options: object): object Formats a module reports methods array. |
|
private |
_formatMethod(methodReport: MethodReport, options: object): object Formats a module or class reports methods array. |
|
private |
_formatModule(report: ModuleReport, reportsAvailable: boolean, options: object): object Formats a module report. |
|
private |
_formatProject(report: ProjectReport, options: object): object Formats a project report with minimal metrics. |
Public Constructors
public constructor(keys: *) source
Params:
Name | Type | Attribute | Description |
keys | * |
|
Public Methods
public formatReport(report: ClassReport | MethodReport | ModuleReport | ProjectReport, options: object): string source
Formats a report as a JSON string with minimal metrics.
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. |
public isSupported(reportType: ReportType): boolean source
Returns whether a given ReportType is supported by this format transform.
Params:
Name | Type | Attribute | Description |
reportType | ReportType | A given report type. |
Private Methods
private _formatClass(classReport: ClassReport, options: object): object source
Formats a module reports methods array.
Params:
Name | Type | Attribute | Description |
classReport | ClassReport | A ClassReport instance to format. |
|
options | object | (Optional) One or more optional parameters passed to the formatter. |
private _formatMethod(methodReport: MethodReport, options: object): object source
Formats a module or class reports methods array.
Params:
Name | Type | Attribute | Description |
methodReport | MethodReport | A method report instance to format. |
|
options | object | (Optional) One or more optional parameters passed to the formatter. |
private _formatModule(report: ModuleReport, reportsAvailable: boolean, options: object): object source
Formats a module report.
Params:
Name | Type | Attribute | Description |
report | 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 _formatProject(report: ProjectReport, options: object): object source
Formats a project report with minimal metrics.
Params:
Name | Type | Attribute | Description |
report | ProjectReport | A project report. |
|
options | object | (Optional) One or more optional parameters passed to the formatter. |
Return:
object |
Return Properties:
Name | Type | Attribute | Description |
classReport | Array<string> | An array of entry keys found in the class report to output. |
|
methodReport | Array<string> | An array of entry keys found in the method report to output. |
|
moduleReport | Array<string> | An array of entry keys found in the module report to output. |
|
projectReport | Array<string> | An array of entry keys found in the project report to output. |