[Pkg-javascript-commits] [node-array-differ] 04/06: New upstream version 1.0.0

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 49f877e133a90a9464255110a83de551aca05dc8
Author: Sruthi <srud at disroot.org>
Date:   Thu Nov 3 22:56:39 2016 +0530

    New upstream version 1.0.0
---
 .editorconfig |  6 +++++-
 .jshintrc     | 13 +++++++++++++
 .travis.yml   |  3 +--
 index.js      |  8 +++++---
 package.json  | 14 +++++---------
 readme.md     |  8 ++++----
 test.js       | 10 +++++-----
 7 files changed, 38 insertions(+), 24 deletions(-)

diff --git a/.editorconfig b/.editorconfig
index 98a761d..8311fe1 100644
--- a/.editorconfig
+++ b/.editorconfig
@@ -1,3 +1,4 @@
+# editorconfig.org
 root = true
 
 [*]
@@ -7,6 +8,9 @@ charset = utf-8
 trim_trailing_whitespace = true
 insert_final_newline = true
 
-[{package.json,*.yml}]
+[package.json]
 indent_style = space
 indent_size = 2
+
+[*.md]
+trim_trailing_whitespace = false
diff --git a/.jshintrc b/.jshintrc
new file mode 100644
index 0000000..804f8af
--- /dev/null
+++ b/.jshintrc
@@ -0,0 +1,13 @@
+{
+	"node": true,
+	"esnext": true,
+	"bitwise": true,
+	"camelcase": true,
+	"curly": true,
+	"immed": true,
+	"newcap": true,
+	"noarg": true,
+	"undef": true,
+	"unused": "vars",
+	"strict": true
+}
diff --git a/.travis.yml b/.travis.yml
index c9c9848..244b7e8 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -1,4 +1,3 @@
-sudo: false
 language: node_js
 node_js:
-  - '6'
+  - '0.10'
diff --git a/index.js b/index.js
index 85e0737..fbe2ed2 100644
--- a/index.js
+++ b/index.js
@@ -1,5 +1,7 @@
 'use strict';
-module.exports = (arr, ...values) => {
-	const rest = new Set([].concat(...values));
-	return arr.filter(x => !rest.has(x));
+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/package.json b/package.json
index e898381..a8c4683 100644
--- a/package.json
+++ b/package.json
@@ -1,19 +1,19 @@
 {
   "name": "array-differ",
-  "version": "2.0.3",
+  "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 at gmail.com",
-    "url": "sindresorhus.com"
+    "url": "http://sindresorhus.com"
   },
   "engines": {
-    "node": ">=6"
+    "node": ">=0.10.0"
   },
   "scripts": {
-    "test": "xo && ava"
+    "test": "mocha"
   },
   "files": [
     "index.js"
@@ -27,10 +27,6 @@
     "exclude"
   ],
   "devDependencies": {
-    "ava": "*",
-    "xo": "*"
-  },
-  "xo": {
-    "esnext": true
+    "mocha": "*"
   }
 }
diff --git a/readme.md b/readme.md
index f05131b..68f5d36 100644
--- a/readme.md
+++ b/readme.md
@@ -5,7 +5,7 @@
 
 ## Install
 
-```
+```sh
 $ npm install --save array-differ
 ```
 
@@ -13,7 +13,7 @@ $ npm install --save array-differ
 ## Usage
 
 ```js
-const arrayDiffer = require('array-differ');
+var arrayDiffer = require('array-differ');
 
 arrayDiffer([2, 3, 4], [3, 50]);
 //=> [2, 4]
@@ -23,7 +23,7 @@ arrayDiffer([2, 3, 4], [3, 50]);
 
 ### arrayDiffer(input, values, [values, ...])
 
-Returns a new array.
+Returns the new array.
 
 #### input
 
@@ -38,4 +38,4 @@ Arrays of values to exclude.
 
 ## License
 
-MIT © [Sindre Sorhus](https://sindresorhus.com)
+MIT © [Sindre Sorhus](http://sindresorhus.com)
diff --git a/test.js b/test.js
index 5fbfc98..d3f3858 100644
--- a/test.js
+++ b/test.js
@@ -1,7 +1,7 @@
-import test from 'ava';
-import m from './';
+'use strict';
+var assert = require('assert');
+var arrayDifference = require('./');
 
-test(t => {
-	t.deepEqual(m([2, 3, 4], [3, 50, 60]), [2, 4]);
-	t.deepEqual(m([2, 3, 4], [3, 50], [2, 60]), [4]);
+it('should filter out the difference', function () {
+	assert.deepEqual(arrayDifference([2, 3, 4], [3, 50, 60]), [2, 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