[Pkg-javascript-commits] [node-array-differ] 01/06: Import Upstream version 2.0.3

Sruthi Chandran srud-guest at moszumanska.debian.org
Thu Nov 3 17:31:10 UTC 2016


This is an automated email from the git hooks/post-receive script.

srud-guest pushed a commit to branch master
in repository node-array-differ.

commit 7fb7770c630d320f0c64d5df03cafe57bd1eb1c2
Author: Sruthi <srud at disroot.org>
Date:   Thu Nov 3 21:33:39 2016 +0530

    Import Upstream version 2.0.3
---
 .editorconfig  | 12 ++++++++++++
 .gitattributes |  1 +
 .gitignore     |  1 +
 .travis.yml    |  4 ++++
 index.js       |  5 +++++
 license        | 21 +++++++++++++++++++++
 package.json   | 36 ++++++++++++++++++++++++++++++++++++
 readme.md      | 41 +++++++++++++++++++++++++++++++++++++++++
 test.js        |  7 +++++++
 9 files changed, 128 insertions(+)

diff --git a/.editorconfig b/.editorconfig
new file mode 100644
index 0000000..98a761d
--- /dev/null
+++ b/.editorconfig
@@ -0,0 +1,12 @@
+root = true
+
+[*]
+indent_style = tab
+end_of_line = lf
+charset = utf-8
+trim_trailing_whitespace = true
+insert_final_newline = true
+
+[{package.json,*.yml}]
+indent_style = space
+indent_size = 2
diff --git a/.gitattributes b/.gitattributes
new file mode 100644
index 0000000..176a458
--- /dev/null
+++ b/.gitattributes
@@ -0,0 +1 @@
+* text=auto
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..3c3629e
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1 @@
+node_modules
diff --git a/.travis.yml b/.travis.yml
new file mode 100644
index 0000000..c9c9848
--- /dev/null
+++ b/.travis.yml
@@ -0,0 +1,4 @@
+sudo: false
+language: node_js
+node_js:
+  - '6'
diff --git a/index.js b/index.js
new file mode 100644
index 0000000..85e0737
--- /dev/null
+++ b/index.js
@@ -0,0 +1,5 @@
+'use strict';
+module.exports = (arr, ...values) => {
+	const rest = new Set([].concat(...values));
+	return arr.filter(x => !rest.has(x));
+};
diff --git a/license b/license
new file mode 100644
index 0000000..654d0bf
--- /dev/null
+++ b/license
@@ -0,0 +1,21 @@
+The MIT License (MIT)
+
+Copyright (c) Sindre Sorhus <sindresorhus at 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/package.json b/package.json
new file mode 100644
index 0000000..e898381
--- /dev/null
+++ b/package.json
@@ -0,0 +1,36 @@
+{
+  "name": "array-differ",
+  "version": "2.0.3",
+  "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 at gmail.com",
+    "url": "sindresorhus.com"
+  },
+  "engines": {
+    "node": ">=6"
+  },
+  "scripts": {
+    "test": "xo && ava"
+  },
+  "files": [
+    "index.js"
+  ],
+  "keywords": [
+    "array",
+    "difference",
+    "diff",
+    "differ",
+    "filter",
+    "exclude"
+  ],
+  "devDependencies": {
+    "ava": "*",
+    "xo": "*"
+  },
+  "xo": {
+    "esnext": true
+  }
+}
diff --git a/readme.md b/readme.md
new file mode 100644
index 0000000..f05131b
--- /dev/null
+++ b/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 --save array-differ
+```
+
+
+## Usage
+
+```js
+const arrayDiffer = require('array-differ');
+
+arrayDiffer([2, 3, 4], [3, 50]);
+//=> [2, 4]
+```
+
+## API
+
+### arrayDiffer(input, values, [values, ...])
+
+Returns a new array.
+
+#### input
+
+Type: `array`
+
+#### values
+
+Type: `array`
+
+Arrays of values to exclude.
+
+
+## License
+
+MIT © [Sindre Sorhus](https://sindresorhus.com)
diff --git a/test.js b/test.js
new file mode 100644
index 0000000..5fbfc98
--- /dev/null
+++ b/test.js
@@ -0,0 +1,7 @@
+import test from 'ava';
+import m from './';
+
+test(t => {
+	t.deepEqual(m([2, 3, 4], [3, 50, 60]), [2, 4]);
+	t.deepEqual(m([2, 3, 4], [3, 50], [2, 60]), [4]);
+});

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-javascript/node-array-differ.git



More information about the Pkg-javascript-commits mailing list