|
Last change
on this file was a762898, checked in by istevanoska <ilinastevanoska@…>, 5 months ago |
|
Added visualizations
|
-
Property mode
set to
100644
|
|
File size:
506 bytes
|
| Line | |
|---|
| 1 | 'use strict';
|
|---|
| 2 |
|
|---|
| 3 | Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|---|
| 4 |
|
|---|
| 5 | const flatMapDepth = require('./flatMapDepth.js');
|
|---|
| 6 | const uniq = require('../../array/uniq.js');
|
|---|
| 7 | const isArrayLikeObject = require('../predicate/isArrayLikeObject.js');
|
|---|
| 8 |
|
|---|
| 9 | function union(...arrays) {
|
|---|
| 10 | const validArrays = arrays.filter(isArrayLikeObject.isArrayLikeObject);
|
|---|
| 11 | const flattened = flatMapDepth.flatMapDepth(validArrays, v => Array.from(v), 1);
|
|---|
| 12 | return uniq.uniq(flattened);
|
|---|
| 13 | }
|
|---|
| 14 |
|
|---|
| 15 | exports.union = union;
|
|---|
Note:
See
TracBrowser
for help on using the repository browser.