MCPcopy
hub / github.com/nestjs/nest / addLeadingSlash

Function addLeadingSlash

packages/common/utils/shared.utils.ts:26–31  ·  view source on GitHub ↗
(path?: string)

Source from the content-addressed store, hash-verified

24};
25
26export const addLeadingSlash = (path?: string): string =>
27 path && typeof path === 'string'
28 ? path.charAt(0) !== '/' && path.substring(0, 2) !== '{/'
29 ? '/' + path
30 : path
31 : '';
32
33export const normalizePath = (path?: string): string =>
34 path

Callers 15

registerRouterMethod · 0.90
constructorMethod · 0.90
extractPathsFromMethod · 0.90
extractPathFromMethod · 0.90
mapToExcludeRouteFunction · 0.90
getRouteInfoFromPathMethod · 0.90
toRouteInfoMethod · 0.90
normalizeGlobalPathMethod · 0.90
utils.spec.tsFile · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected