Home Manual Reference Source Test Repository
public class | source

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

Formats a report as a JSON string with minimal metrics.

public

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

Formats a project report with minimal metrics.

Public Constructors

public constructor(keys: *) source

Params:

NameTypeAttributeDescription
keys *
  • optional
  • default: s_DEFAULT_KEYS

Public Members

public get extension: string: string source

Gets the file extension.

Return:

string

public get name: string: string source

Gets the format name.

Return:

string

public get type: string: string source

Gets the format type.

Return:

string

Private Members

private _keys: * source

Public Methods

public formatReport(report: ClassReport | MethodReport | ModuleReport | ProjectReport, options: object): string source

Formats a report as a JSON string with minimal metrics.

Params:

NameTypeAttributeDescription
report ClassReport | MethodReport | ModuleReport | ProjectReport

A report to format.

options object

(Optional) One or more optional parameters passed to the formatter.

Return:

string

Return Properties:

NameTypeAttributeDescription
spacing number

(Optional) An integer defining the JSON output spacing.

public isSupported(reportType: ReportType): boolean source

Returns whether a given ReportType is supported by this format transform.

Params:

NameTypeAttributeDescription
reportType ReportType

A given report type.

Return:

boolean

Private Methods

private _formatClass(classReport: ClassReport, options: object): object source

Formats a module reports methods array.

Params:

NameTypeAttributeDescription
classReport ClassReport

A ClassReport instance to format.

options object

(Optional) One or more optional parameters passed to the formatter.

Return:

object

Return Properties:

NameTypeAttributeDescription
classReport string

An entry key found in the class report to output.

methodReport string

An entry key found in the method report to output.

private _formatMethod(methodReport: MethodReport, options: object): object source

Formats a module or class reports methods array.

Params:

NameTypeAttributeDescription
methodReport MethodReport

A method report instance to format.

options object

(Optional) One or more optional parameters passed to the formatter.

Return:

object

Return Properties:

NameTypeAttributeDescription
methodReport string

An entry key found in the method report to output.

private _formatModule(report: ModuleReport, reportsAvailable: boolean, options: object): object source

Formats a module report.

Params:

NameTypeAttributeDescription
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.

Return:

object

Return Properties:

NameTypeAttributeDescription
classReport string

An entry key found in the class report to output.

methodReport string

An entry key found in the method report to output.

moduleReport string

An entry key found in the module report to output.

private _formatProject(report: ProjectReport, options: object): object source

Formats a project report with minimal metrics.

Params:

NameTypeAttributeDescription
report ProjectReport

A project report.

options object

(Optional) One or more optional parameters passed to the formatter.

Return:

object

Return Properties:

NameTypeAttributeDescription
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.