Module / v1.0.0-beta.7

@typed/router/Parser

34 unique exports available through this public import path, including their members and aliases.

import * as Parser from "@typed/router/Parser";

Parser composition

  • Parser.FlatMap

    interface

    Selects the next Parser from a successful value and continues at the remaining input.

  • Parser.FlatMapTo

    interface

    Binds a Parser and dependent mapping lambda for reuse.

  • Parser.Map

    interface

    Transforms a successful parser value without changing its remaining input.

  • Parser.MapTo

    interface

    Binds a Parser and mapping lambda for reuse as a type lambda.

  • Parser.Optional

    interface

    Returns undefined and the original input when its parser fails.

  • Parser.OptionalOf

    interface

    Binds a Parser for optional evaluation.

  • Parser.OrElse

    interface

    Runs the fallback parser from the original input when the first parser fails.

  • Parser.OrElseWith

    interface

    Binds a fallback Parser for later composition.

  • Parser.Zip

    interface

    Runs two parsers sequentially and returns both values.

  • Parser.ZipWith

    interface

    Binds a second Parser for later sequential composition.

Parser contracts

  • Parse

    type-alias

    Applies a type-level Parser to a string literal input.

  • Parser

    interface

    A type lambda from a string literal to a parse result.

  • Parser.Any

    type-alias

    A Parser whose output is intentionally widened to unknown.

  • Parser.Run

    type-alias

    Runs a Parser against a string literal input.

  • Result

    type-alias

    A parsed value paired with the unconsumed string suffix.

Parser primitives

Parser repetition