Skip to main content
Using Deno in production at your company? Earn free Deno merch.
Give us feedback
Module

x/oak/deps.ts>pathToRegexp

A middleware framework for handling HTTP with Deno 🐿️ 🦕
Extremely Popular
Go to Latest
function pathToRegexp
import { pathToRegexp } from "https://deno.land/x/oak@v12.1.0/deps.ts";

Normalize the given path string, returning a regular expression.

An empty array can be passed in for the keys, which will hold the placeholder key descriptions. For example, using /user/:id, keys will contain [{ name: 'id', delimiter: '/', optional: false, repeat: false }].

Parameters

path: Path
optional
keys: Key[]