• Utility function that provides a bit cleaner interface for running a parser.

    This one throws an error in case parser didn't match OR the match is incomplete (some part of input string left unparsed).

    Input string is broken down to characters as [...str] unless you provide a pre-split array.

    Returns

    A matched value.

    Type Parameters

    • TOptions

    • TValue

    Parameters

    • parser: Parser<string, TOptions, TValue>

      A parser to run.

    • str: string | string[]

      Input string or an array of graphemes.

    • options: TOptions

      Parser options.

    Returns TValue

Generated using TypeDoc