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

Function stripLeadingSlash

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

Source from the content-addressed store, hash-verified

40 * ```
41 */
42export function stripLeadingSlash(url: string): string {
43 // Check if the first character of the URL is a slash
44 return url.length > 1 && url[0] === '/' ? url.slice(1) : url;
45}
46
47/**
48 * Adds a leading slash to a URL if it does not already have one.

Callers 6

url_spec.tsFile · 0.90
traverseRoutesConfigFunction · 0.90
handleSSGRouteFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected