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

Method includes

source/predicates/array.ts:83–88  ·  view source on GitHub ↗

Test an array to include all 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

81 @param searchElements - The values that should be included in the array.
82 */
83 includes(...searchElements: readonly T[]): this {
84 return this.addValidator({
85 message: (value, label) => `Expected ${label} to include all elements of \`${JSON.stringify(searchElements)}\`, got \`${JSON.stringify(value)}\``,
86 validator: value => searchElements.every(element => value.includes(element)),
87 });
88 }
89
90 /**
91 Test an array to include any of the provided elements. The values are tested by identity, not structure.

Callers 7

messageIncludesMethod · 0.45
includesAnyMethod · 0.45
oneOfMethod · 0.45
test.tsFile · 0.45
string-email.tsFile · 0.45
array.tsFile · 0.45
string.tsFile · 0.45

Calls 1

addValidatorMethod · 0.80

Tested by

no test coverage detected