UNPKG

rambda

Version:

Lightweight and faster alternative to Ramda with included TS definitions

12 lines (10 loc) 231 B
export function unionWith(predicate, x) { return y => { const filtered = y.filter(yInstance => { return x.every(xInstance => { return !predicate(xInstance, yInstance) }) }) return [...x, ...filtered] } }