source: node_modules/es-toolkit/dist/compat/array/union.js

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
RevLine 
[a762898]1'use strict';
2
3Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
4
5const flatMapDepth = require('./flatMapDepth.js');
6const uniq = require('../../array/uniq.js');
7const isArrayLikeObject = require('../predicate/isArrayLikeObject.js');
8
9function 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
15exports.union = union;
Note: See TracBrowser for help on using the repository browser.