`/api/v1` + `/items` → `/api/v1/items`; `/items` + `` → `/items`; `` + `` → ``.
(prefix: string, path: string)
| 396 | |
| 397 | /** `/api/v1` + `/items` → `/api/v1/items`; `/items` + `` → `/items`; `` + `` → ``. */ |
| 398 | function joinPyPaths(prefix: string, path: string): string { |
| 399 | const a = prefix.replace(/\/+$/, ''); |
| 400 | const b = path.replace(/^\/+/, ''); |
| 401 | if (!a) return b ? `/${b}` : ''; |
| 402 | return b ? `${a}/${b}` : a; |
| 403 | } |
| 404 | |
| 405 | /** |
| 406 | * The file and variable an `include_router` argument names: `items.router` |