MCPcopy
hub / github.com/sindresorhus/got / validateSearchParameters

Function validateSearchParameters

source/core/options.ts:1097–1106  ·  view source on GitHub ↗
(searchParameters: Record<string, unknown>)

Source from the content-addressed store, hash-verified

1095const isToughCookieJar = (cookieJar: PromiseCookieJar | ToughCookieJar): cookieJar is ToughCookieJar => cookieJar.setCookie.length === 4 && cookieJar.getCookieString.length === 0;
1096
1097function validateSearchParameters(searchParameters: Record<string, unknown>): asserts searchParameters is Record<string, string | number | boolean | undefined> {
1098 for (const key of Object.keys(searchParameters)) {
1099 if (key === '__proto__') {
1100 continue;
1101 }
1102
1103 const value = searchParameters[key];
1104 assertAny(`searchParams.${key}`, [is.string, is.number, is.boolean, is.null, is.undefined], value);
1105 }
1106}
1107
1108/**
1109All parsing methods supported by Got.

Callers 1

searchParamsMethod · 0.85

Calls 1

assertAnyFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…