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

Function addLeadingSlash

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

Source from the content-addressed store, hash-verified

57 * ```
58 */
59export function addLeadingSlash(url: string): string {
60 // Check if the URL already starts with a slash
61 return url[0] === '/' ? url : `/${url}`;
62}
63
64/**
65 * Adds a trailing slash to a URL if it does not already have one.

Callers 3

url_spec.tsFile · 0.90
insertMethod · 0.90
joinUrlPartsFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected