MCPcopy
hub / github.com/freshframework/fresh / mergePath

Function mergePath

packages/fresh/src/router.ts:335–348  ·  view source on GitHub ↗
(
  basePath: string,
  path: string,
  isMounting: boolean,
)

Source from the content-addressed store, hash-verified

333}
334
335export function mergePath(
336 basePath: string,
337 path: string,
338 isMounting: boolean,
339): string {
340 if (basePath.endsWith("*")) basePath = basePath.slice(0, -1);
341 if (basePath === "/") basePath = "";
342
343 if (path === "*") path = isMounting ? "" : "/*";
344 else if (path === "/*") path = "/*";
345
346 const s = (basePath !== "" && path === "/") ? "" : path;
347 return basePath + s;
348}
349
350export function toRoutePath(path: string): string {
351 if (path === "") return "*";

Callers 3

applyCommandsInnerFunction · 0.90
router_test.tsFile · 0.90
mountAppMethod · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected