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

Function firstPathSegment

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

Source from the content-addressed store, hash-verified

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

Callers 1

Calls 1

isValidOrgSlugFunction · 0.90

Tested by

no test coverage detected