diff options
Diffstat (limited to 'node_modules/array-differ')
-rw-r--r-- | node_modules/array-differ/index.js | 7 | ||||
-rw-r--r-- | node_modules/array-differ/package.json | 32 | ||||
-rw-r--r-- | node_modules/array-differ/readme.md | 41 |
3 files changed, 80 insertions, 0 deletions
diff --git a/node_modules/array-differ/index.js b/node_modules/array-differ/index.js new file mode 100644 index 000000000..fbe2ed2c8 --- /dev/null +++ b/node_modules/array-differ/index.js @@ -0,0 +1,7 @@ +'use strict'; +module.exports = function (arr) { + var rest = [].concat.apply([], [].slice.call(arguments, 1)); + return arr.filter(function (el) { + return rest.indexOf(el) === -1; + }); +}; diff --git a/node_modules/array-differ/package.json b/node_modules/array-differ/package.json new file mode 100644 index 000000000..a8c46831f --- /dev/null +++ b/node_modules/array-differ/package.json @@ -0,0 +1,32 @@ +{ + "name": "array-differ", + "version": "1.0.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": "http://sindresorhus.com" + }, + "engines": { + "node": ">=0.10.0" + }, + "scripts": { + "test": "mocha" + }, + "files": [ + "index.js" + ], + "keywords": [ + "array", + "difference", + "diff", + "differ", + "filter", + "exclude" + ], + "devDependencies": { + "mocha": "*" + } +} diff --git a/node_modules/array-differ/readme.md b/node_modules/array-differ/readme.md new file mode 100644 index 000000000..68f5d3607 --- /dev/null +++ b/node_modules/array-differ/readme.md @@ -0,0 +1,41 @@ +# array-differ [](https://travis-ci.org/sindresorhus/array-differ) + +> Create an array with values that are present in the first input array but not additional ones + + +## Install + +```sh +$ npm install --save array-differ +``` + + +## Usage + +```js +var arrayDiffer = require('array-differ'); + +arrayDiffer([2, 3, 4], [3, 50]); +//=> [2, 4] +``` + +## API + +### arrayDiffer(input, values, [values, ...]) + +Returns the new array. + +#### input + +Type: `array` + +#### values + +Type: `array` + +Arrays of values to exclude. + + +## License + +MIT © [Sindre Sorhus](http://sindresorhus.com) |