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

Function assertAny

source/core/options.ts:902–906  ·  view source on GitHub ↗

Helper function that wraps assert.any() to provide better error messages. When assertion fails, it includes the option name in the error message.

(optionName: string, validators: Array<(value: unknown) => boolean>, value: unknown)

Source from the content-addressed store, hash-verified

900When assertion fails, it includes the option name in the error message.
901*/
902function assertAny(optionName: string, validators: Array<(value: unknown) => boolean>, value: unknown): void {
903 wrapAssertionWithContext(optionName, () => {
904 assert.any(validators, value);
905 });
906}
907
908/**
909Helper function that wraps assert.plainObject() to provide better error messages.

Callers 15

validateSearchParametersFunction · 0.85
constructorMethod · 0.85
requestMethod · 0.85
agentMethod · 0.85
timeoutMethod · 0.85
prefixUrlMethod · 0.85
bodyMethod · 0.85
formMethod · 0.85
urlMethod · 0.85
cookieJarMethod · 0.85
signalMethod · 0.85
searchParamsMethod · 0.85

Calls 1

wrapAssertionWithContextFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…