MCPcopy Index your code
hub / github.com/freeCodeCamp/freeCodeCamp / haveSamePath

Function haveSamePath

api/src/utils/redirection.ts:169–176  ·  view source on GitHub ↗
(
  redirectBase: string | URL,
  returnUrl: string | URL
)

Source from the content-addressed store, hash-verified

167 * @returns A boolean indicating whether the paths are the same.
168 */
169export function haveSamePath(
170 redirectBase: string | URL,
171 returnUrl: string | URL
172) {
173 const base = new URL(redirectBase);
174 const url = new URL(returnUrl);
175 return base.pathname === url.pathname;
176}

Callers 1

handleRedirectsFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected