Socket
Socket
Sign inDemoInstall

array-differ

Package Overview
Dependencies
Maintainers
1
Versions
9
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

array-differ - npm Package Compare versions

Comparing version 2.1.0 to 3.0.0

34

index.d.ts
/**
* 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

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