Skip to main content
Deno 2 is finally here 🎉️
Learn more
Module

x/path_to_regexp/index.ts

Turn a path string such as `/user/:name` into a regular expression
Go to Latest
import * as pathToRegexp from "https://deno.land/x/path_to_regexp@v7.1.0/index.ts";

Classes

Tokenized path instance. Can we passed around instead of string.

Functions

Compile a string to a template function for the path.

Create path match function from path-to-regexp spec.

Parse a string for the raw tokens.

Normalize the given path string, returning a regular expression.

Interfaces

A key is a capture group in the regex.

A match result contains data about the path match.

Type Aliases

Decode a string into another string.

Encode a string into another string.

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

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

Repeated and simple input types.

A token is a string (nothing special) or key metadata (capture group).