|
Last change
on this file was a762898, checked in by istevanoska <ilinastevanoska@…>, 5 months ago |
|
Added visualizations
|
-
Property mode
set to
100644
|
|
File size:
376 bytes
|
| Rev | Line | |
|---|
| [a762898] | 1 | import { flatMapDepth } from './flatMapDepth.mjs';
|
|---|
| 2 | import { uniq } from '../../array/uniq.mjs';
|
|---|
| 3 | import { isArrayLikeObject } from '../predicate/isArrayLikeObject.mjs';
|
|---|
| 4 |
|
|---|
| 5 | function union(...arrays) {
|
|---|
| 6 | const validArrays = arrays.filter(isArrayLikeObject);
|
|---|
| 7 | const flattened = flatMapDepth(validArrays, v => Array.from(v), 1);
|
|---|
| 8 | return uniq(flattened);
|
|---|
| 9 | }
|
|---|
| 10 |
|
|---|
| 11 | export { union };
|
|---|
Note:
See
TracBrowser
for help on using the repository browser.