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

Function mergeDestinationQueryIntoUrl

packages/next-routing/src/resolve-routes.ts:191–203  ·  view source on GitHub ↗
(url: URL, destination: string)

Source from the content-addressed store, hash-verified

189}
190
191function mergeDestinationQueryIntoUrl(url: URL, destination: string): URL {
192 const mergedUrl = new URL(url.toString())
193 const destinationSearch = destination.split('?')[1]
194 if (!destinationSearch) {
195 return mergedUrl
196 }
197
198 const destinationParams = new URLSearchParams(destinationSearch)
199 for (const [key, value] of destinationParams.entries()) {
200 mergedUrl.searchParams.set(key, value)
201 }
202 return mergedUrl
203}
204
205function withResolvedInvocationTarget({
206 result,

Callers 2

checkDynamicRoutesFunction · 0.85
resolveRoutesFunction · 0.85

Calls 4

splitMethod · 0.80
setMethod · 0.65
toStringMethod · 0.45
entriesMethod · 0.45

Tested by

no test coverage detected