MCPcopy
hub / github.com/vitejs/vite / stripBase

Function stripBase

packages/vite/src/node/utils.ts:1659–1665  ·  view source on GitHub ↗
(path: string, base: string)

Source from the content-addressed store, hash-verified

1657}
1658
1659export function stripBase(path: string, base: string): string {
1660 if (path === base) {
1661 return '/'
1662 }
1663 const devBase = withTrailingSlash(base)
1664 return path.startsWith(devBase) ? path.slice(devBase.length - 1) : path
1665}
1666
1667export function arrayEqual(a: any[], b: any[]): boolean {
1668 if (a === b) return true

Callers 4

baseMiddlewareFunction · 0.90
preTransformRequestFunction · 0.90
transformFunction · 0.90

Calls 1

withTrailingSlashFunction · 0.90

Tested by

no test coverage detected