(prefix: string, path: string)
| 619 | |
| 620 | /** `/api` + `/users` → `/api/users`; `/api/` + `/` → `/api`. */ |
| 621 | export function joinPaths(prefix: string, path: string): string { |
| 622 | const a = prefix.replace(/\/+$/, ''); |
| 623 | const b = path.replace(/^\/+/, ''); |
| 624 | const joined = b ? `${a}/${b}` : a; |
| 625 | return joined === '' ? '/' : joined; |
| 626 | } |
| 627 | |
| 628 | /** |
| 629 | * The file a mount's last argument names: an inline `require('./x')`, an |
no outgoing calls
no test coverage detected