MCPcopy Index your code
hub / github.com/simstudioai/sim / searchParamsToObject

Function searchParamsToObject

apps/sim/lib/api/server/validation.ts:199–210  ·  view source on GitHub ↗
(
  searchParams: URLSearchParams
)

Source from the content-addressed store, hash-verified

197}
198
199export function searchParamsToObject(
200 searchParams: URLSearchParams
201): Record<string, string | string[]> {
202 const output: Record<string, string | string[]> = {}
203
204 for (const key of new Set(searchParams.keys())) {
205 const values = searchParams.getAll(key)
206 output[key] = values.length > 1 ? values : (values[0] ?? '')
207 }
208
209 return output
210}
211
212export function headersToObject(headers: Headers): Record<string, string> {
213 const output: Record<string, string> = {}

Callers 4

route.tsFile · 0.90
route.tsFile · 0.90
route.tsFile · 0.90
parseRequestFunction · 0.85

Calls 1

getAllMethod · 0.80

Tested by

no test coverage detected