array-differ
Advanced tools
Comparing version 2.0.3 to 2.1.0
'use strict'; | ||
module.exports = (arr, ...values) => { | ||
const arrayDiffer = (array, ...values) => { | ||
const rest = new Set([].concat(...values)); | ||
return arr.filter(x => !rest.has(x)); | ||
return array.filter(x => !rest.has(x)); | ||
}; | ||
module.exports = arrayDiffer; | ||
module.exports.default = arrayDiffer; |
{ | ||
"name": "array-differ", | ||
"version": "2.0.3", | ||
"description": "Create an array with values that are present in the first input array but not additional ones", | ||
"license": "MIT", | ||
"repository": "sindresorhus/array-differ", | ||
"author": { | ||
"name": "Sindre Sorhus", | ||
"email": "sindresorhus@gmail.com", | ||
"url": "sindresorhus.com" | ||
}, | ||
"engines": { | ||
"node": ">=6" | ||
}, | ||
"scripts": { | ||
"test": "xo && ava" | ||
}, | ||
"files": [ | ||
"index.js" | ||
], | ||
"keywords": [ | ||
"array", | ||
"difference", | ||
"diff", | ||
"differ", | ||
"filter", | ||
"exclude" | ||
], | ||
"devDependencies": { | ||
"ava": "*", | ||
"xo": "*" | ||
}, | ||
"xo": { | ||
"esnext": true | ||
} | ||
"name": "array-differ", | ||
"version": "2.1.0", | ||
"description": "Create an array with values that are present in the first input array but not additional ones", | ||
"license": "MIT", | ||
"repository": "sindresorhus/array-differ", | ||
"author": { | ||
"name": "Sindre Sorhus", | ||
"email": "sindresorhus@gmail.com", | ||
"url": "sindresorhus.com" | ||
}, | ||
"engines": { | ||
"node": ">=6" | ||
}, | ||
"scripts": { | ||
"test": "xo && ava && tsd-check" | ||
}, | ||
"files": [ | ||
"index.js", | ||
"index.d.ts" | ||
], | ||
"keywords": [ | ||
"array", | ||
"difference", | ||
"diff", | ||
"differ", | ||
"filter", | ||
"exclude" | ||
], | ||
"devDependencies": { | ||
"ava": "^1.2.1", | ||
"tsd-check": "^0.3.0", | ||
"xo": "^0.24.0" | ||
} | ||
} |
@@ -9,3 +9,3 @@ # array-differ [![Build Status](https://travis-ci.org/sindresorhus/array-differ.svg?branch=master)](https://travis-ci.org/sindresorhus/array-differ) | ||
``` | ||
$ npm install --save array-differ | ||
$ npm install array-differ | ||
``` | ||
@@ -25,3 +25,3 @@ | ||
### arrayDiffer(input, values, [values, ...]) | ||
### arrayDiffer(input, ...values) | ||
@@ -32,7 +32,7 @@ Returns a new array. | ||
Type: `array` | ||
Type: `unknown[]` | ||
#### values | ||
Type: `array` | ||
Type: `unknown[]` | ||
@@ -39,0 +39,0 @@ Arrays of values to exclude. |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Trivial Package
Supply chain riskPackages less than 10 lines of code are easily copied into your own project and may not warrant the additional supply chain risk of an external dependency.
Found 1 instance in 1 package
3072
5
22
0
3