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

Function _stripBasePath

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

Source from the content-addressed store, hash-verified

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

Callers 1

normalizeMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected