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

Function fsPathFromId

packages/vite/src/node/utils.ts:236–241  ·  view source on GitHub ↗
(id: string)

Source from the content-addressed store, hash-verified

234}
235
236export function fsPathFromId(id: string): string {
237 const fsPath = normalizePath(
238 id.startsWith(FS_PREFIX) ? id.slice(FS_PREFIX.length) : id,
239 )
240 return fsPath[0] === '/' || VOLUME_RE.test(fsPath) ? fsPath : `/${fsPath}`
241}
242
243export function fsPathFromUrl(url: string): string {
244 return fsPathFromId(cleanUrl(url))

Callers 6

getHtmlFilenameFunction · 0.90
indexHtmlMiddlewareFunction · 0.90
transformMiddlewareFunction · 0.90
handlerFunction · 0.90
fsPathFromUrlFunction · 0.85
prettifyUrlFunction · 0.85

Calls 1

normalizePathFunction · 0.85

Tested by

no test coverage detected