MCPcopy Create free account
hub / github.com/react-static/react-static / pathJoin

Function pathJoin

packages/react-static/src/browser/utils/index.js:48–59  ·  view source on GitHub ↗
(...paths)

Source from the content-addressed store, hash-verified

46}
47
48export function pathJoin(...paths) {
49 let newPath = paths.map(cleanSlashes).join('/')
50 if (!newPath || newPath === '/') {
51 return '/'
52 }
53
54 newPath = cleanSlashes(newPath)
55 if (newPath.includes('?')) {
56 newPath = newPath.substring(0, newPath.indexOf('?'))
57 }
58 return newPath
59}
60
61// This function is for extracting a routePath from a path or string
62// RoutePaths do not have query params, basePaths, and should

Callers 9

getPermaLinkFunction · 0.90
getRouteInfoFunction · 0.90
prefetchDataFunction · 0.90
normalizeRouteFunction · 0.90
HeadWithMeta.jsFile · 0.90
BodyWithMeta.jsFile · 0.90
handleFunction · 0.90
getRoutePathFunction · 0.85
shared.test.jsFile · 0.85

Calls 1

cleanSlashesFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…