MCPcopy Index your code
hub / github.com/loopbackio/loopback-next / joinPath

Function joinPath

packages/rest/src/router/controller-route.ts:233–240  ·  view source on GitHub ↗
(basePath: string, path: string)

Source from the content-addressed store, hash-verified

231}
232
233export function joinPath(basePath: string, path: string) {
234 const fullPath = [basePath, path]
235 .join('/') // Join by /
236 .replace(/(\/){2,}/g, '/') // Remove extra /
237 .replace(/\/$/, '') // Remove trailing /
238 .replace(/^(\/)?/, '/'); // Add leading /
239 return fullPath;
240}

Callers 2

Calls

no outgoing calls

Tested by

no test coverage detected