MCPcopy Index your code
hub / github.com/react-static/react-static / cutPathToRoot

Function cutPathToRoot

packages/react-static/src/browser/utils/index.js:8–9  ·  view source on GitHub ↗
(string = '')

Source from the content-addressed store, hash-verified

6const REGEX_TO_REMOVE_DOUBLE_SLASH = /\/{2,}/g
7
8export const cutPathToRoot = (string = '') =>
9 string.replace(REGEX_TO_CUT_TO_ROOT, '$1')
10
11export const trimLeadingSlashes = (string = '') =>
12 string.replace(REGEX_TO_REMOVE_LEADING_SLASH, '')

Callers 2

buildConfigFunction · 0.90
shared.test.jsFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…