Socket
Socket
Sign inDemoInstall

arr-diff

Package Overview
Dependencies
0
Maintainers
1
Versions
11
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 0.1.0 to 0.1.1

2

bower.json
{
"name": "arr-diff",
"version": "0.1.0",
"version": "0.1.1",
"main": [

@@ -5,0 +5,0 @@ "index.js"

@@ -27,16 +27,21 @@ /*!

module.exports = function difference(a, b) {
var alen = a.length - 1;
var blen = b.length;
if (alen === 0) {
if (a == null) {
return [];
}
if (blen === 0) {
if (!Array.isArray(b)) {
return a;
}
if (!Array.isArray(a)) {
throw new TypeError();
}
var alen = a.length;
var blen = b.length;
var arr = [];
for (var i = alen; i >= 0; i--) {
for (var i = 0; i < alen; i++) {
var key = a[i];
if (b.indexOf(key) === -1) {

@@ -43,0 +48,0 @@ arr.push(key);

{
"name": "arr-diff",
"description": "Return an array with only the unique values present in all given arrays using strict equality for comparisons.",
"version": "0.1.0",
"version": "0.1.1",
"homepage": "https://github.com/jonschlinkert/arr-diff",

@@ -6,0 +6,0 @@ "author": {

@@ -73,2 +73,2 @@ # arr-diff [![NPM version](https://badge.fury.io/js/arr-diff.svg)](http://badge.fury.io/js/arr-diff)

_This file was generated by [verb-cli](https://github.com/assemble/verb-cli) on September 26, 2014._
_This file was generated by [verb-cli](https://github.com/assemble/verb-cli) on October 02, 2014._

@@ -16,4 +16,10 @@ /*!

diff(['a', 'b', 'c'], ['b', 'c', 'e']).should.eql(['a']);
diff(['foo', 'b', 'c', 'e', 'bar'], ['b', 'foo', 'e']).should.eql(['bar', 'c']);
diff(['foo', 'b', 'c', 'e', 'bar'], ['b', 'foo', 'e']).should.eql(['c', 'bar']);
diff(['foo', 'foo'], ['a', 'b', 'c']).should.eql(['foo', 'foo']);
diff(['foo'], ['a', 'b', 'c']).should.eql(['foo']);
});
});
it('should return an empty array if no unique elements are in the first array:', function () {
diff(['foo'], ['a', 'b', 'c', 'foo']).should.eql([]);
});
});
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc