MCPcopy Create free account
hub / github.com/UsefulSoftwareCo/executor / firstPathSegment

Function firstPathSegment

apps/cloud/src/auth/handlers.ts:93–97  ·  view source on GitHub ↗
(path: string)

Source from the content-addressed store, hash-verified

91}));
92
93const firstPathSegment = (path: string): string | null => {
94 const pathname = path.split(/[?#]/, 1)[0] ?? "";
95 const segment = pathname.split("/")[1];
96 return segment && isValidOrgSlug(segment) ? segment : null;
97};
98
99const requestedOrgSelectorFromReturnTo = (returnTo: string): string | null =>
100 firstPathSegment(returnTo);

Callers 1

Calls 1

isValidOrgSlugFunction · 0.90

Tested by

no test coverage detected