Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

absurdum

Package Overview
Dependencies
Maintainers
1
Versions
177
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

absurdum - npm Package Compare versions

Comparing version 0.35.0 to 0.36.0

docs/arrays/union.md

23

dist/absurdum.cjs.js

@@ -531,2 +531,24 @@ 'use strict';

/**
* Union creates an array of unique elements from all given arrays in order encountered
*
* @param {Array} arrays input arrays
* @returns {Array} an array of unique elements from all given arrays
*
* @example
* const result = arrays.union([2], [1, 2, 3, 1]);
* > [2, 1, 3]
*/
function union (...arrays) {
return Array.from([...arrays].reduce((acc, curr, i) => {
if (Array.isArray(curr)) {
curr.reduce((res, cur) => {
acc.add(cur);
return res;
}, '');
}
return acc;
}, new Set()));
}
/**
* Removes all duplicate items of an array

@@ -608,2 +630,3 @@ *

tap: tap,
union: union,
unique: unique,

@@ -610,0 +633,0 @@ zip: zip

@@ -527,2 +527,24 @@ /**

/**
* Union creates an array of unique elements from all given arrays in order encountered
*
* @param {Array} arrays input arrays
* @returns {Array} an array of unique elements from all given arrays
*
* @example
* const result = arrays.union([2], [1, 2, 3, 1]);
* > [2, 1, 3]
*/
function union (...arrays) {
return Array.from([...arrays].reduce((acc, curr, i) => {
if (Array.isArray(curr)) {
curr.reduce((res, cur) => {
acc.add(cur);
return res;
}, '');
}
return acc;
}, new Set()));
}
/**
* Removes all duplicate items of an array

@@ -604,2 +626,3 @@ *

tap: tap,
union: union,
unique: unique,

@@ -606,0 +629,0 @@ zip: zip

2

package.json
{
"name": "absurdum",
"version": "0.35.0",
"version": "0.36.0",
"description": "Reductio Ad Absurdum - The Ridiculous Application of Reduce",

@@ -5,0 +5,0 @@ "keywords": [

@@ -70,2 +70,3 @@ [![GitHub Releases](https://img.shields.io/github/release/vanillaes/absurdum.svg)](https://github.com/vanillaes/absurdum/releases)

- [tap][arrays.tap]
- [union][arrays.union]
- [unique][arrays.unique]

@@ -95,2 +96,3 @@ - [zip][arrays.zip]

[arrays.tap]: ./docs/arrays/tap.md
[arrays.union]: ./docs/arrays/union.md
[arrays.unique]: ./docs/arrays/unique.md

@@ -97,0 +99,0 @@ [arrays.zip]: ./docs/arrays/zip.md

@@ -23,2 +23,3 @@ export { chunk } from "./chunk.js";

export { unique } from "./unique.js";
export { union } from "./union.js";
export { zip } from "./zip.js";

@@ -22,3 +22,4 @@ export { chunk } from './chunk.js';

export { tap } from './tap.js';
export { union } from './union.js';
export { unique } from './unique.js';
export { zip } from './zip.js';
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc