Module route_regex

Source
Expand description

The following code was mostly generated using GTP-4 from next.js/packages/next/src/shared/lib/router/utils/route-regex.ts

Structs§

Group
NamedMiddlewareRegex
NamedRouteRegex
RouteRegex

Functions§

get_named_middleware_regex
Generates a named regexp. This is intended to be using for build time only.
get_named_route_regex
This function extends getRouteRegex generating also a named regexp where each group is named along with a routeKeys object that indexes the assigned named group with its corresponding key.
get_route_regex
From a normalized route this function generates a regular expression and a corresponding groups object intended to be used to store matching groups from the regular expression.