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

Function trimPathRight

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

Source from the content-addressed store, hash-verified

33
34/** Trim trailing slashes (except preserving root '/'). */
35export function trimPathRight(path: string) {
36 const len = path.length
37 return len > 1 && path[len - 1] === '/' ? path.replace(/\/{1,}$/, '') : path
38}
39
40/** Trim both leading and trailing slashes. */
41export function trimPath(path: string) {

Callers 8

matchRoutesInternalMethod · 0.90
RouterCoreClass · 0.90
getMatchedRoutesFunction · 0.90
BaseRouteClass · 0.90
useTransitionerSetupFunction · 0.90
TransitionerFunction · 0.90
TransitionerFunction · 0.90
trimPathFunction · 0.70

Calls 1

replaceMethod · 0.65

Tested by

no test coverage detected