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

Function firstPathSegment

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

Source from the content-addressed store, hash-verified

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

Callers 1

Calls 1

isValidOrgSlugFunction · 0.90

Tested by

no test coverage detected