(isEquivalent: (self: A, that: A) => boolean)
| 3313 | * @since 2.0.0 |
| 3314 | */ |
| 3315 | export const differenceWith = <A>(isEquivalent: (self: A, that: A) => boolean): { |
| 3316 | (that: Iterable<A>): (self: Iterable<A>) => Array<A> |
| 3317 | (self: Iterable<A>, that: Iterable<A>): Array<A> |
| 3318 | } => { |
| 3319 | const has = containsWith(isEquivalent) |
| 3320 | return dual( |
| 3321 | 2, |
| 3322 | (self: Iterable<A>, that: Iterable<A>): Array<A> => { |
| 3323 | const thatArray = fromIterable(that) |
| 3324 | return fromIterable(self).filter((a) => !has(thatArray, a)) |
| 3325 | } |
| 3326 | ) |
| 3327 | } |
| 3328 | |
| 3329 | /** |
| 3330 | * Computes elements in the first array that are not in the second, using |
no test coverage detected