You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
26 lines
609 B
26 lines
609 B
2 weeks ago
|
/**
|
||
|
Create an array of unique values, in order, from the input arrays.
|
||
|
|
||
|
@example
|
||
|
```
|
||
|
import arrayUnion = require('array-union');
|
||
|
|
||
|
arrayUnion([1, 1, 2, 3], [2, 3]);
|
||
|
//=> [1, 2, 3]
|
||
|
|
||
|
arrayUnion(['foo', 'foo', 'bar']);
|
||
|
//=> ['foo', 'bar']
|
||
|
|
||
|
arrayUnion(['🐱', '🦄', '🐻'], ['🦄', '🌈']);
|
||
|
//=> ['🐱', '🦄', '🐻', '🌈']
|
||
|
|
||
|
arrayUnion(['🐱', '🦄'], ['🐻', '🦄'], ['🐶', '🌈', '🌈']);
|
||
|
//=> ['🐱', '🦄', '🐻', '🐶', '🌈']
|
||
|
```
|
||
|
*/
|
||
|
declare function arrayUnion<ArgumentsType extends readonly unknown[]>(
|
||
|
...arguments: readonly ArgumentsType[]
|
||
|
): ArgumentsType;
|
||
|
|
||
|
export = arrayUnion;
|