Class PathnameTemplate

A template of a pathname pattern.

Constructors

  • Creates a new PathnameTemplate instance.

    Parameters

    • pattern: string

      A pathname pattern from which a template is derived.

    • isCaseSensitive: boolean = false

      If true then pathname is matched in a case-sensitive manner.

    Returns PathnameTemplate

Properties

isCaseSensitive: boolean

true if pathname is matched in a case-sensitive manner.

paramNames: ReadonlySet<string>

Names of template params.

pattern: string

A pathname pattern from which a template is derived.

Methods

  • Matches a pathname against a pathname pattern.

    Parameters

    • pathname: string

    Returns null | PathnameMatch

  • Creates a pathname from a template by substituting params, beginning with a "/".

    Parameters

    • Optionalparams: void | Dict

    Returns string