New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

arr-exclude

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

arr-exclude - npm Package Compare versions

Comparing version 1.0.0 to 2.0.0

13

index.js

@@ -1,10 +0,7 @@

'use strict';
module.exports = function (input, exclude) {
if (!Array.isArray(input)) {
return [];
export default function arrayExclude(array, exclusions) {
if (!Array.isArray(array)) {
throw new TypeError(`Expected an array, got \`${typeof array}\``);
}
return input.filter(function (x) {
return exclude.indexOf(x) === -1;
});
};
return array.filter(item => !exclusions.includes(item));
}
{
"name": "arr-exclude",
"version": "1.0.0",
"description": "Exclude certain items from an array",
"license": "MIT",
"repository": "sindresorhus/arr-exclude",
"author": {
"name": "Sindre Sorhus",
"email": "sindresorhus@gmail.com",
"url": "sindresorhus.com"
},
"engines": {
"node": ">=0.10.0"
},
"scripts": {
"test": "xo && ava"
},
"files": [
"index.js"
],
"keywords": [
"array",
"arr",
"list",
"exclude",
"blacklist",
"ignore",
"without",
"items",
"elements",
"values",
"filter"
],
"devDependencies": {
"ava": "*",
"xo": "*"
}
"name": "arr-exclude",
"version": "2.0.0",
"description": "Exclude certain items from an array",
"license": "MIT",
"repository": "sindresorhus/arr-exclude",
"funding": "https://github.com/sponsors/sindresorhus",
"author": {
"name": "Sindre Sorhus",
"email": "sindresorhus@gmail.com",
"url": "https://sindresorhus.com"
},
"type": "module",
"exports": "./index.js",
"engines": {
"node": "^12.20.0 || ^14.13.1 || >=16.0.0"
},
"scripts": {
"test": "xo && ava"
},
"files": [
"index.js"
],
"keywords": [
"array",
"list",
"exclude",
"ignore",
"without",
"items",
"elements",
"values",
"filter"
],
"devDependencies": {
"ava": "^3.15.0",
"xo": "^0.44.0"
}
}

@@ -1,30 +0,22 @@

# arr-exclude [![Build Status](https://travis-ci.org/sindresorhus/arr-exclude.svg?branch=master)](https://travis-ci.org/sindresorhus/arr-exclude)
# arr-exclude
> Exclude certain items from an array
## Install
```
$ npm install --save arr-exclude
$ npm install arr-exclude
```
## Usage
```js
var arrExclude = require('arr-exclude');
import arrayExclude from 'arr-exclude';
arrExclude(['a', 'b', 'c'], ['b']);
arrayExclude(['a', 'b', 'c'], ['b']);
//=> ['a', 'c']
```
## Related
- [arr-include](https://github.com/sindresorhus/arr-include) - Include only certain items in an array
## License
MIT © [Sindre Sorhus](http://sindresorhus.com)

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