Hi there! Are you looking for the official Deno documentation? Try docs.deno.com for all your Deno learning needs.

Usage

import * as pathToRegexp from "https://raw.githubusercontent.com/pillarjs/path-to-regexp/master/src/index.ts";

§Classes

TokenData

Tokenized path instance.

§Functions

compile

Compile a string to a template function for the path.

match

Transform a path into a match function.

parse

Parse a string for the raw tokens.

pathToRegexp
stringify

Stringify token data into a path string.

§Interfaces

CompileOptions
Group

A set of possible tokens to expand when matching.

MatchOptions
MatchResult

A match result contains data about the path match.

Parameter

A parameter designed to match arbitrary text within a segment.

ParseOptions
PathToRegexpOptions
Text

Plain text.

Wildcard

A wildcard parameter designed to match multiple segments.

§Type Aliases

Decode

Decode a string into another string.

Encode

Encode a string into another string.

Key

A token that corresponds with a regexp capture.

Keys

A sequence of path-to-regexp keys that match capturing groups.

Match

A match is either false (no match) or a match result.

MatchFunction

The match function takes a string and returns whether it matched the path.

ParamData
Path

Supported path types.

PathFunction
Token

A sequence of path match characters.