* Join route path segments the way Laravel does: `('api', 'v1/', '/users')` → * `/api/v1/users`. Leading and trailing slashes don't matter; the root is `/`.
(...parts: string[])
| 431 | * `/api/v1/users`. Leading and trailing slashes don't matter; the root is `/`. |
| 432 | */ |
| 433 | function joinRoutePath(...parts: string[]): string { |
| 434 | const segments = parts.flatMap((p) => p.split('/')).filter((s) => s !== ''); |
| 435 | return '/' + segments.join('/'); |
| 436 | } |
| 437 | |
| 438 | /** Index of the `)` closing the `(` at `open`, skipping PHP strings; -1 if unbalanced. */ |
| 439 | function matchParen(s: string, open: number): number { |
no test coverage detected