( basePath: string, path: string, isMounting: boolean, )
| 333 | } |
| 334 | |
| 335 | export 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 | |
| 350 | export function toRoutePath(path: string): string { |
| 351 | if (path === "") return "*"; |
no outgoing calls
no test coverage detected