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

Function escapeToLinuxLikePath

packages/vite/src/node/utils.ts:825–833  ·  view source on GitHub ↗
(path: string)

Source from the content-addressed store, hash-verified

823const replaceWindowsDriveRE = /^([A-Z]):\//
824const linuxAbsolutePathRE = /^\/[^/]/
825function escapeToLinuxLikePath(path: string) {
826 if (windowsDriveRE.test(path)) {
827 return path.replace(replaceWindowsDriveRE, '/windows/$1/')
828 }
829 if (linuxAbsolutePathRE.test(path)) {
830 return `/linux${path}`
831 }
832 return path
833}
834
835const revertWindowsDriveRE = /^\/windows\/([A-Z])\//
836function unescapeToLinuxLikePath(path: string) {

Callers 1

combineSourcemapsFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected