Create an array of unique values, in order, from the input arrays
$ npm install array-union
import arrayUnion from 'array-union';
arrayUnion([1, 1, 2, 3], [2, 3]);
//=> [1, 2, 3]
arrayUnion(['foo', 'foo', 'bar']);
//=> ['foo', 'bar']
arrayUnion(['๐ฑ', '๐ฆ', '๐ป'], ['๐ฆ', '๐']);
//=> ['๐ฑ', '๐ฆ', '๐ป', '๐']
arrayUnion(['๐ฑ', '๐ฆ'], ['๐ป', '๐ฆ'], ['๐ถ', '๐', '๐']);
//=> ['๐ฑ', '๐ฆ', '๐ป', '๐ถ', '๐']
Tidelift helps make open source sustainable for maintainers while giving companies
assurances about security, maintenance, and licensing for their dependencies.