next-router-mock
Version:
Mock implementation of the Next.js Router
20 lines (17 loc) • 464 B
text/typescript
import {
getRouteMatcher,
getRouteRegex,
getSortedRoutes,
isDynamicRoute,
// @ts-expect-error
} from "next/dist/next-server/lib/router/utils";
// @ts-expect-error
import { normalizePagePath } from "next/dist/next-server/server/normalize-page-path";
import { factory } from "../createDynamicRouteParser";
export const createDynamicRouteParser = factory({
getSortedRoutes,
getRouteMatcher,
getRouteRegex,
isDynamicRoute,
normalizePagePath,
});