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

Function injectQuery

packages/vite/src/node/utils.ts:335–339  ·  view source on GitHub ↗
(url: string, queryToInject: string)

Source from the content-addressed store, hash-verified

333}
334
335export function injectQuery(url: string, queryToInject: string): string {
336 const { file, postfix } = splitFileAndPostfix(url)
337 const normalizedFile = isWindows ? slash(file) : file
338 return `${normalizedFile}?${queryToInject}${postfix[0] === '?' ? `&${postfix.slice(1)}` : /* hash only */ postfix}`
339}
340
341const timestampRE = /\bt=\d{13}&?\b/
342export function removeTimestampQuery(url: string): string {

Callers 15

replacerFunction · 0.90
transformMiddlewareFunction · 0.90
handlerFunction · 0.90
normalizeUrlFunction · 0.90
transformFunction · 0.90
oxcResolvePluginFunction · 0.90
handlerFunction · 0.90
ensureVersionQueryFunction · 0.90
tryNodeResolveFunction · 0.90
handlerFunction · 0.90

Calls 2

splitFileAndPostfixFunction · 0.90
slashFunction · 0.90

Tested by

no test coverage detected