MCPcopy Create free account
hub / github.com/colbymchenry/codegraph / joinRoutePath

Function joinRoutePath

src/resolution/frameworks/laravel.ts:433–436  ·  view source on GitHub ↗

* 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[])

Source from the content-addressed store, hash-verified

431 * `/api/v1/users`. Leading and trailing slashes don't matter; the root is `/`.
432 */
433function 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. */
439function matchParen(s: string, open: number): number {

Callers 4

extractFunction · 0.85
postExtractFunction · 0.85
routeGroupsFunction · 0.85
prefixAtFunction · 0.85

Calls 1

joinMethod · 0.45

Tested by

no test coverage detected