(isEquivalent: (self: A, that: A) => boolean)
| 2639 | * @since 2.0.0 |
| 2640 | */ |
| 2641 | export 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 |
no test coverage detected