(isEquivalent: (self: A, that: A) => boolean)
| 527 | * @since 2.0.0 |
| 528 | */ |
| 529 | export const containsWith = <A>(isEquivalent: (self: A, that: A) => boolean): { |
| 530 | (a: A): (self: Iterable<A>) => boolean |
| 531 | (self: Iterable<A>, a: A): boolean |
| 532 | } => |
| 533 | dual(2, (self: Iterable<A>, a: A): boolean => { |
| 534 | for (const i of self) { |
| 535 | if (isEquivalent(a, i)) { |
| 536 | return true |
| 537 | } |
| 538 | } |
| 539 | return false |
| 540 | }) |
| 541 | |
| 542 | const _equivalence = Equal.equivalence() |
| 543 |