Home Manual Reference Source Test Repository
public class | source

FormatJSONModules

Provides a format transform for ESComplex ModuleReport / ProjectReport instances converting them to JSON that includes only the filePath, srcPath, and / or srcPathAlias of module report entries.

Member Summary

Public Members
public get

Gets the file extension.

public get

Gets the format name.

public get

Gets the format type.

Method Summary

Public Methods
public

Formats a report as a JSON string with just module data.

public

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

Private Methods
private

Formats a module report as a JSON string.

private

Formats a project report modules as a JSON string.

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

Public Methods

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

Formats a report as a JSON string with just module data.

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 _formatModule(moduleReport: ModuleReport): object source

Formats a module report as a JSON string. Please note that the exported JSON only contains data for ModuleReport instances contained in a ProjectReport.

Params:

NameTypeAttributeDescription
moduleReport ModuleReport

A module report.

Return:

object

private _formatProject(projectReport: ProjectReport): object source

Formats a project report modules as a JSON string.

Params:

NameTypeAttributeDescription
projectReport ProjectReport

A project report.

Return:

object