Options
All
  • Public
  • Public/Protected
  • All
Menu

Class Parser

Abstract Parser

A shared base class for all variations of Parsers to share the same API. Several utility helper methods are defined to help subclasses implement the parse methods.

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

Abstract parse

  • parse(_: any, __: object): Promise<Report>
  • Parse (Asynchronously)

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

    Parameters

    • _: any
    • __: object
      • Optional encoding?: undefined | string
      • 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

Abstract parseSync

  • parseSync(_: any, __: object): Report
  • Parse (Synchronously)

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

    Parameters

    • _: any
    • __: object
      • Optional encoding?: undefined | string
      • Optional mode?: ReportMode
      • Optional rootDirectory?: undefined | string

    Returns Report

    Parsed Report

Generated using TypeDoc