MCPcopy Create free account
hub / github.com/Effect-TS/effect / containsWith

Function containsWith

packages/effect/src/Array.ts:2641–2652  ·  view source on GitHub ↗
(isEquivalent: (self: A, that: A) => boolean)

Source from the content-addressed store, hash-verified

2639 * @since 2.0.0
2640 */
2641export const containsWith = <A>(isEquivalent: (self: A, that: A) => boolean): {
2642 (a: A): (self: Iterable<A>) => boolean
2643 (self: Iterable<A>, a: A): boolean
2644} =>
2645 dual(2, (self: Iterable<A>, a: A): boolean => {
2646 for (const i of self) {
2647 if (isEquivalent(a, i)) {
2648 return true
2649 }
2650 }
2651 return false
2652 })
2653
2654/**
2655 * Checks whether an array contains a value, using `Equal.asEquivalence()` for

Callers 4

Array.tsFile · 0.70
intersectionWithFunction · 0.70
differenceWithFunction · 0.70
Option.test.tsFile · 0.50

Calls 1

isEquivalentFunction · 0.85

Tested by

no test coverage detected