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

Function partialEncodeURIPath

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

Source from the content-addressed store, hash-verified

1802 * that can handle un-encoded URIs, where `%` is the only ambiguous character.
1803 */
1804export function partialEncodeURIPath(uri: string): string {
1805 if (uri.startsWith('data:')) return uri
1806 const filePath = cleanUrl(uri)
1807 const postfix = filePath !== uri ? uri.slice(filePath.length) : ''
1808 return filePath.replaceAll('%', '%25') + postfix
1809}
1810
1811export function decodeURIIfPossible(input: string): string | undefined {
1812 try {

Callers 3

build.tsFile · 0.90
handlerFunction · 0.90

Calls 1

cleanUrlFunction · 0.90

Tested by

no test coverage detected