MCPcopy
hub / github.com/vercel/next.js / encodeURIComponent

Function encodeURIComponent

packages/next/src/server/server-route-utils.ts:15–30  ·  view source on GitHub ↗
(value)

Source from the content-addressed store, hash-verified

13
14 return stringifyQs(query, undefined, undefined, {
15 encodeURIComponent(value) {
16 if (
17 value in initialQuery ||
18 initialQueryValues.some((initialQueryVal) => {
19 // `value` always refers to a query value, even if it's nested in an array
20 return Array.isArray(initialQueryVal)
21 ? initialQueryVal.includes(value)
22 : initialQueryVal === value
23 })
24 ) {
25 // Encode keys and values from initial query
26 return encodeURIComponent(value)
27 }
28
29 return value
30 },
31 })
32}

Callers 15

existsInRepoFunction · 0.85
canonicalizeURLPartFunction · 0.85
defaultLoaderFunction · 0.85
formatProdErrorMessageFunction · 0.85
escapeFragmentFunction · 0.85
createFakeServerFunctionFunction · 0.85
createFakeFunctionFunction · 0.85
createFakeServerFunctionFunction · 0.85
createFakeFunctionFunction · 0.85
createFakeServerFunctionFunction · 0.85
createFakeFunctionFunction · 0.85

Calls 3

someMethod · 0.80
isArrayMethod · 0.80
includesMethod · 0.80

Tested by 7

runTestsFunction · 0.68
runTestsFunction · 0.68
revalidatePathFunction · 0.68
revalidatePathFunction · 0.68
getImageOptimizerPathFunction · 0.68
runTestsFunction · 0.68
getTimestampPageDataFunction · 0.68