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

Function encodeURIPath

packages/vite/src/node/utils.ts:1793–1798  ·  view source on GitHub ↗
(uri: string)

Source from the content-addressed store, hash-verified

1791 * Encodes the URI path portion (ignores part after ? or #)
1792 */
1793export function encodeURIPath(uri: string): string {
1794 if (uri.startsWith('data:')) return uri
1795 const filePath = cleanUrl(uri)
1796 const postfix = filePath !== uri ? uri.slice(filePath.length) : ''
1797 return encodeURI(filePath) + postfix
1798}
1799
1800/**
1801 * Like `encodeURIPath`, but only replacing `%` as `%25`. This is useful for environments

Callers 7

handlerFunction · 0.90
generateBundleFunction · 0.90
renderAssetUrlInJSFunction · 0.90
handlerFunction · 0.90
renderChunkFunction · 0.90
resolveAssetUrlsInCssFunction · 0.90
renderChunkFunction · 0.90

Calls 1

cleanUrlFunction · 0.90

Tested by

no test coverage detected