Options
All
  • Public
  • Public/Protected
  • All
Menu

Class ContentParser

Content Parser

An extension of {@link Parser | Parser} that supports reading data from a string.

Hierarchy

Index

Methods

Protected createBuilder

  • Create a ReportBuilder from the given options

    Parameters

    • Optional rootDirectory: undefined | string

      base directory that all paths are relativized from

    • Default value mode: ReportMode = ReportMode.Simple

      The type of builder that should be created. Defaults to Simple

    Returns ReportBuilder

    ReportBuilder

parse

  • parse(contents: string, options?: object): Promise<Report>
  • Parse (Asynchronously)

    Parse an input with the given options and return a Promise of a Report.

    remarks

    Since the input data of this Parser is a string variable, this method proxies the synchronous method

    Parameters

    • contents: string

      data that should be parsed

    • Default value options: object = {}

      Optional options to control how the report is generated:

      • encoding - the type of encoding of the input data
      • rootDirectory - base directory that all paths are relativized from
      • mode - The type of Report that should be built
      • Optional mode?: ReportMode
      • Optional rootDirectory?: undefined | string

    Returns Promise<Report>

    Promise that resolves with a parsed Report

Protected parseContents

  • parseContents(contents: string, rootDirectory?: undefined | string, mode?: ReportMode): Report
  • Parse the string contents and return a Report

    Parameters

    • contents: string

      string containing input that should be parsed

    • Optional rootDirectory: undefined | string

      base directory that all paths are relativized from

    • Optional mode: ReportMode

      The type of builder that should be created

    Returns Report

    Parsed Report

parseSync

  • parseSync(contents: string, options?: object): Report
  • Parse (Synchronously)

    Parse an input with the given options and return a Report.

    Parameters

    • contents: string

      data that should be parsed

    • Default value options: object = {}

      Optional options to control how the report is generated:

      • encoding - the type of encoding of the input data
      • rootDirectory - base directory that all paths are relativized from
      • mode - The type of Report that should be built
      • Optional mode?: ReportMode
      • Optional rootDirectory?: undefined | string

    Returns Report

    Parsed Report

Generated using TypeDoc