MCPcopy Create free account
hub / github.com/ProNextJS/declarative-routing / fixPath

Function fixPath

src/shared/build-tools.ts:34–42  ·  view source on GitHub ↗
(config: Config, path: string)

Source from the content-addressed store, hash-verified

32}
33
34function fixPath(config: Config, path: string) {
35 const { stripRoutePrefix } = config;
36 if (!stripRoutePrefix) return path;
37 if (path === `/${stripRoutePrefix}`) return "/";
38 return path.replace(
39 stripRoutePrefix.endsWith("/") ? stripRoutePrefix : stripRoutePrefix + "/",
40 ""
41 );
42}
43
44async function writeRoutes(silent: boolean = false) {
45 const config = getConfig();

Callers 1

writeRoutesFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected