summaryrefslogtreecommitdiff
path: root/src/node_modules/array-differ
diff options
context:
space:
mode:
Diffstat (limited to 'src/node_modules/array-differ')
-rw-r--r--src/node_modules/array-differ/index.d.ts21
-rw-r--r--src/node_modules/array-differ/index.js8
-rw-r--r--src/node_modules/array-differ/license9
-rw-r--r--src/node_modules/array-differ/package.json35
-rw-r--r--src/node_modules/array-differ/readme.md41
5 files changed, 114 insertions, 0 deletions
diff --git a/src/node_modules/array-differ/index.d.ts b/src/node_modules/array-differ/index.d.ts
new file mode 100644
index 0000000..3a038ea
--- /dev/null
+++ b/src/node_modules/array-differ/index.d.ts
@@ -0,0 +1,21 @@
+/**
+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;
diff --git a/src/node_modules/array-differ/index.js b/src/node_modules/array-differ/index.js
new file mode 100644
index 0000000..0dab1b8
--- /dev/null
+++ b/src/node_modules/array-differ/index.js
@@ -0,0 +1,8 @@
+'use strict';
+
+const arrayDiffer = (array, ...values) => {
+ const rest = new Set([].concat(...values));
+ return array.filter(element => !rest.has(element));
+};
+
+module.exports = arrayDiffer;
diff --git a/src/node_modules/array-differ/license b/src/node_modules/array-differ/license
new file mode 100644
index 0000000..e7af2f7
--- /dev/null
+++ b/src/node_modules/array-differ/license
@@ -0,0 +1,9 @@
+MIT License
+
+Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (sindresorhus.com)
+
+Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
diff --git a/src/node_modules/array-differ/package.json b/src/node_modules/array-differ/package.json
new file mode 100644
index 0000000..e4ade95
--- /dev/null
+++ b/src/node_modules/array-differ/package.json
@@ -0,0 +1,35 @@
+{
+ "name": "array-differ",
+ "version": "3.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": "sindresorhus.com"
+ },
+ "engines": {
+ "node": ">=8"
+ },
+ "scripts": {
+ "test": "xo && ava && tsd"
+ },
+ "files": [
+ "index.js",
+ "index.d.ts"
+ ],
+ "keywords": [
+ "array",
+ "difference",
+ "diff",
+ "differ",
+ "filter",
+ "exclude"
+ ],
+ "devDependencies": {
+ "ava": "^1.4.1",
+ "tsd": "^0.7.2",
+ "xo": "^0.24.0"
+ }
+}
diff --git a/src/node_modules/array-differ/readme.md b/src/node_modules/array-differ/readme.md
new file mode 100644
index 0000000..b98cc06
--- /dev/null
+++ b/src/node_modules/array-differ/readme.md
@@ -0,0 +1,41 @@
+# array-differ [![Build Status](https://travis-ci.org/sindresorhus/array-differ.svg?branch=master)](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
+
+```
+$ npm install array-differ
+```
+
+
+## Usage
+
+```js
+const arrayDiffer = require('array-differ');
+
+arrayDiffer([2, 3, 4], [3, 50]);
+//=> [2, 4]
+```
+
+## API
+
+### arrayDiffer(input, ...values)
+
+Returns a new array.
+
+#### input
+
+Type: `unknown[]`
+
+#### values
+
+Type: `unknown[]`
+
+Arrays of values to exclude.
+
+
+## License
+
+MIT © [Sindre Sorhus](https://sindresorhus.com)