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

Function firstPathSegment

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

Source from the content-addressed store, hash-verified

98}));
99
100const firstPathSegment = (path: string): string | null => {
101 const pathname = path.split(/[?#]/, 1)[0] ?? "";
102 const segment = pathname.split("/")[1];
103 return segment && isValidOrgSlug(segment) ? segment : null;
104};
105
106const requestedOrgSelectorFromReturnTo = (returnTo: string): string | null =>
107 firstPathSegment(returnTo);

Callers 1

Calls 1

isValidOrgSlugFunction · 0.90

Tested by

no test coverage detected