Abstract class to base all parsers on. It is created in a monadic form, so that the parse method should be callable on raw and parsed data. Each parser has the option to accept and return:

  • raw data
  • parsed data
  • undefined The FreeParser has the most freedoms of all parsers:
  • allows skipping parsing if the data is not parsable (returning the original data)
  • allows filtering the data (returning undefined if the data should be filtered out)

Type Parameters

  • R = any

    The type of the raw data to parse.

  • P = any

    The type of the parsed data.

Hierarchy

Constructors

Methods

Constructors

Methods

  • Parses the given data.

    Parameters

    • data: R | P

      Data to be parsed.

    • Optional context: any

      Additional context, if needed.

    Returns undefined | R | P | Promise<undefined | R | P>

Generated using TypeDoc