MCPcopy
hub / github.com/TanStack/router / trimPathLeft

Function trimPathLeft

packages/router-core/src/path.ts:30–32  ·  view source on GitHub ↗
(path: string)

Source from the content-addressed store, hash-verified

28
29/** Trim leading slashes (except preserving root '/'). */
30export function trimPathLeft(path: string) {
31 return path === '/' ? path : path.replace(/^\/{1,}/, '')
32}
33
34/** Trim trailing slashes (except preserving root '/'). */
35export function trimPathRight(path: string) {

Callers 3

BaseRouteClass · 0.90
path.test.tsFile · 0.90
trimPathFunction · 0.70

Calls 1

replaceMethod · 0.65

Tested by

no test coverage detected