Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
MR414N-ID
GitHub Repository: MR414N-ID/botku2
Path: blob/master/node_modules/array-union/index.d.ts
1126 views
1
/**
2
Create an array of unique values, in order, from the input arrays.
3
4
@example
5
```
6
import arrayUnion = require('array-union');
7
8
arrayUnion([1, 1, 2, 3], [2, 3]);
9
//=> [1, 2, 3]
10
11
arrayUnion(['foo', 'foo', 'bar']);
12
//=> ['foo', 'bar']
13
14
arrayUnion(['🐱', '🦄', '🐻'], ['🦄', '🌈']);
15
//=> ['🐱', '🦄', '🐻', '🌈']
16
17
arrayUnion(['🐱', '🦄'], ['🐻', '🦄'], ['🐶', '🌈', '🌈']);
18
//=> ['🐱', '🦄', '🐻', '🐶', '🌈']
19
```
20
*/
21
declare function arrayUnion<ArgumentsType extends readonly unknown[]>(
22
...arguments: readonly ArgumentsType[]
23
): ArgumentsType;
24
25
export = arrayUnion;
26
27