(isEquivalent: (self: A, that: A) => boolean)
| 2346 | * @since 2.0.0 |
| 2347 | */ |
| 2348 | export const intersectionWith = <A>(isEquivalent: (self: A, that: A) => boolean): { |
| 2349 | (that: Iterable<A>): (self: Iterable<A>) => Array<A> |
| 2350 | (self: Iterable<A>, that: Iterable<A>): Array<A> |
| 2351 | } => { |
| 2352 | const has = containsWith(isEquivalent) |
| 2353 | return dual( |
| 2354 | 2, |
| 2355 | (self: Iterable<A>, that: Iterable<A>): Array<A> => { |
| 2356 | const bs = fromIterable(that) |
| 2357 | return fromIterable(self).filter((a) => has(bs, a)) |
| 2358 | } |
| 2359 | ) |
| 2360 | } |
| 2361 | |
| 2362 | /** |
| 2363 | * Creates an `Array` of unique values that are included in all given `Iterable`s. |
no test coverage detected