Options
All
  • Public
  • Public/Protected
  • All
Menu

@smikhalevski/route-pattern

Index

Type aliases

DataCallback

DataCallback: (data: string, start: number, end: number) => void

Type declaration

    • (data: string, start: number, end: number): void
    • Parameters

      • data: string
      • start: number
      • end: number

      Returns void

Node

OffsetCallback

OffsetCallback: (start: number, end: number) => void

Type declaration

    • (start: number, end: number): void
    • Parameters

      • start: number
      • end: number

      Returns void

Functions

convertNodeToRegExp

convertPatternToRegExp

parsePattern

  • Converts pattern to an AST.

    throws

    SyntaxError If unexpected syntax is met.

    Parameters

    • str: string

      The pattern to parse.

    Returns IPathNode

    The root node of the parsed AST.

tokenizePattern

  • Traverses pattern and invokes callbacks when particular token in met.

    Parameters

    Returns number

    The number of chars that were successfully parsed in str.

visitNode

  • The pattern AST visitor.

    Parameters

    • node: Node | null | undefined

      The pattern AST root node to visit.

    • visitor: INodeVisitor

      The set of callbacks to invoke when particular node is visited.

    Returns void

Generated using TypeDoc