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

x/path_to_regexp/index.ts>tokensToFunction

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

Expose a method for transforming tokens into the path function.

Type Parameters

optional
P extends object = object

Parameters

tokens: Token[]
optional
options: TokensToFunctionOptions = [UNSUPPORTED]