(basePath: string, path: string)
| 231 | } |
| 232 | |
| 233 | export 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 | } |
no outgoing calls
no test coverage detected