(prefix: string, path: string)
| 856 | |
| 857 | /** `/api` + `/users` → `/api/users`; `/api/` + `/` → `/api`. */ |
| 858 | export function joinPaths(prefix: string, path: string): string { |
| 859 | const a = prefix.replace(/\/+$/, ''); |
| 860 | const b = path.replace(/^\/+/, ''); |
| 861 | const joined = b ? `${a}/${b}` : a; |
| 862 | return joined === '' ? '/' : joined; |
| 863 | } |
| 864 | |
| 865 | /** |
| 866 | * The file a mount's last argument names: an inline `require('./x')`, an |
no outgoing calls
no test coverage detected