MCPcopy Create free account
hub / github.com/Snapchat/Valdi / encodeQueryParams

Function encodeQueryParams

src/valdi_modules/src/valdi/coreutils/src/url.ts:9–14  ·  view source on GitHub ↗
(params: EncodableParams)

Source from the content-addressed store, hash-verified

7 * String-encode a query param mapping.
8 */
9export function encodeQueryParams(params: EncodableParams): string {
10 return Object.keys(params)
11 .filter(k => params[k] !== undefined)
12 .map(k => [k, params[k]!].map(encodeURIComponent).join('='))
13 .join('&');
14}
15
16/**
17 * Retrieve a map of from a querystring formatted string

Callers 1

pathWithParamsFunction · 0.85

Calls 4

filterMethod · 0.80
keysMethod · 0.65
joinMethod · 0.45
mapMethod · 0.45

Tested by

no test coverage detected