MCPcopy Create free account
hub / github.com/angular/angular / _stripBasePath

Function _stripBasePath

packages/common/src/location/location.ts:317–326  ·  view source on GitHub ↗
(basePath: string, url: string)

Source from the content-addressed store, hash-verified

315}
316
317function _stripBasePath(basePath: string, url: string): string {
318 if (!basePath || !url.startsWith(basePath)) {
319 return url;
320 }
321 const strippedUrl = url.substring(basePath.length);
322 if (strippedUrl === '' || ['/', ';', '?', '#'].includes(strippedUrl[0])) {
323 return strippedUrl;
324 }
325 return url;
326}
327
328function _stripIndexHtml(url: string): string {
329 return url.replace(/\/index\.html$/, '');

Callers 1

normalizeMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected