MCPcopy
hub / github.com/sindresorhus/ow / includesAny

Method includesAny

source/predicates/array.ts:95–100  ·  view source on GitHub ↗

Test an array to include any of the provided elements. The values are tested by identity, not structure. @param searchElements - The values that should be included in the array.

(...searchElements: readonly T[])

Source from the content-addressed store, hash-verified

93 @param searchElements - The values that should be included in the array.
94 */
95 includesAny(...searchElements: readonly T[]): this {
96 return this.addValidator({
97 message: (value, label) => `Expected ${label} to include any element of \`${JSON.stringify(searchElements)}\`, got \`${JSON.stringify(value)}\``,
98 validator: value => searchElements.some(element => value.includes(element)),
99 });
100 }
101
102 /**
103 Test an array to be empty.

Callers 1

array.tsFile · 0.80

Calls 2

addValidatorMethod · 0.80
includesMethod · 0.45

Tested by

no test coverage detected