MCPcopy Index your code
hub / github.com/angular/angular-cli / stripTrailingSlash

Function stripTrailingSlash

packages/angular/ssr/src/utils/url.ts:23–26  ·  view source on GitHub ↗
(url: string)

Source from the content-addressed store, hash-verified

21 * ```
22 */
23export function stripTrailingSlash(url: string): string {
24 // Check if the last character of the URL is a slash
25 return url.length > 1 && url.at(-1) === '/' ? url.slice(0, -1) : url;
26}
27
28/**
29 * Removes the leading slash from a URL if it exists.

Callers 3

url_spec.tsFile · 0.90
constructSerializedUrlFunction · 0.90
constructUrlFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected