import { freshPathMapper } from "https://deno.land/x/http_fns@v0.0.27/fresh/path_mapper.ts";
A Fresh-like path mapping function.
Supporting Fresh style path segments:
[name]
- to match a single path segment, translates to :name
in the URLPattern
[...name]
- to match multiple path segments, translates to :name*
in the URLPattern
Also, extends the syntax with support for file extensions (see byMediaType
) by adding
.ext
(for a required extension) or [.ext]
(for an optional extension).
Example path: blog/[...path][.ext].tsx
Parameters
entry: DiscoveredPath