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

x/path_to_regexp/index.ts>tokensToRegexp

Turn a path string such as `/user/:name` into a regular expression
Go to Latest
function tokensToRegexp
import { tokensToRegexp } from "https://deno.land/x/path_to_regexp@v6.3.0/index.ts";

Expose a function for taking tokens and returning a RegExp.

Parameters

tokens: Token[]
optional
keys: Key[]
optional
options: TokensToRegexpOptions = [UNSUPPORTED]