array-differ
Advanced tools
Comparing version 2.1.0 to 3.0.0
/** | ||
* Create an array with values that are present in the first array but not additional ones. | ||
* | ||
* @param array - The array to compare against. | ||
* @param values - The arrays with values to be excluded. | ||
* @returns A new array of filtered values. | ||
* | ||
* @example | ||
* | ||
* import arrayDiffer from 'array-differ'; | ||
* | ||
* arrayDiffer([2, 3, 4], [3, 50]); | ||
* //=> [2, 4] | ||
*/ | ||
export default function arrayDiffer<T>(array: ArrayLike<T>, ...values: ArrayLike<T>[]): T[]; | ||
Create an array with values that are present in the first array but not additional ones. | ||
@param array - The array to compare against. | ||
@param values - The arrays with values to be excluded. | ||
@returns A new array of filtered values. | ||
@example | ||
``` | ||
import arrayDiffer = require('array-differ'); | ||
arrayDiffer([2, 3, 4], [3, 50]); | ||
//=> [2, 4] | ||
``` | ||
*/ | ||
declare function arrayDiffer<ValueType>( | ||
array: readonly ValueType[], | ||
...values: (readonly ValueType[])[] | ||
): ValueType[]; | ||
export = arrayDiffer; |
@@ -5,6 +5,5 @@ 'use strict'; | ||
const rest = new Set([].concat(...values)); | ||
return array.filter(x => !rest.has(x)); | ||
return array.filter(element => !rest.has(element)); | ||
}; | ||
module.exports = arrayDiffer; | ||
module.exports.default = arrayDiffer; |
{ | ||
"name": "array-differ", | ||
"version": "2.1.0", | ||
"version": "3.0.0", | ||
"description": "Create an array with values that are present in the first input array but not additional ones", | ||
@@ -13,6 +13,6 @@ "license": "MIT", | ||
"engines": { | ||
"node": ">=6" | ||
"node": ">=8" | ||
}, | ||
"scripts": { | ||
"test": "xo && ava && tsd-check" | ||
"test": "xo && ava && tsd" | ||
}, | ||
@@ -32,6 +32,6 @@ "files": [ | ||
"devDependencies": { | ||
"ava": "^1.2.1", | ||
"tsd-check": "^0.3.0", | ||
"ava": "^1.4.1", | ||
"tsd": "^0.7.2", | ||
"xo": "^0.24.0" | ||
} | ||
} |
Sorry, the diff of this file is not supported yet
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
23
3058