MCPcopy Create free account
hub / github.com/effect-app/libs / containsWith

Function containsWith

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

Source from the content-addressed store, hash-verified

2536 */
2537export const containsWith = <A>(isEquivalent: (self: A, that: A) => boolean): {
2538 (a: A): (self: Iterable<A>) => boolean
2539 (self: Iterable<A>, a: A): boolean
2540} =>
2541 dual(2, (self: Iterable<A>, a: A): boolean => {
2542 for (const i of self) {
2543 if (isEquivalent(a, i)) {
2544 return true
2545 }
2546 }
2547 return false
2548 })
2549
2550/**
2551 * Checks whether an array contains a value, using `Equal.equivalence()` for
2552 * comparison.

Callers 4

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

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…