New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

array-keys

Package Overview
Dependencies
Maintainers
1
Versions
23
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

array-keys - npm Package Compare versions

Comparing version 2.1.3 to 2.2.0

2

bower.json
{
"name": "array-keys",
"version": "2.1.3",
"version": "2.2.0",
"homepage": "https://github.com/silverbucket/array-keys",

@@ -5,0 +5,0 @@ "authors": [

(function(f){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=f()}else if(typeof define==="function"&&define.amd){define([],f)}else{var g;if(typeof window!=="undefined"){g=window}else if(typeof global!=="undefined"){g=global}else if(typeof self!=="undefined"){g=self}else{g=this}g.ArrayKeys = f()}})(function(){var define,module,exports;return (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(require,module,exports){
/*!
* array-keys
* version 2.1.3
* version 2.2.0
* http://github.com/silverbucket/array-keys

@@ -133,3 +133,3 @@ *

count += 1;
setTimeout(cb.bind(null, self._store[i]), 0);
setTimeout(cb.bind(null, self._store[i], i), 0);
}

@@ -161,3 +161,3 @@ setTimeout(finished.bind(null, count), 0);

function E () {
// Keep this empty so it's easier to inherit from
// Keep this empty so it's easier to inherit from
// (via https://github.com/lipsmack from https://github.com/scottcorgan/tiny-emitter/issues/3)

@@ -167,5 +167,5 @@ }

E.prototype = {
on: function (name, callback, ctx) {
on: function (name, callback, ctx) {
var e = this.e || (this.e = {});
(e[name] || (e[name] = [])).push({

@@ -175,3 +175,3 @@ fn: callback,

});
return this;

@@ -182,8 +182,9 @@ },

var self = this;
var fn = function () {
self.off(name, fn);
function listener () {
self.off(name, listener);
callback.apply(ctx, arguments);
};
return this.on(name, fn, ctx);
listener._ = callback
return this.on(name, listener, ctx);
},

@@ -196,7 +197,7 @@

var len = evtArr.length;
for (i; i < len; i++) {
evtArr[i].fn.apply(evtArr[i].ctx, data);
}
return this;

@@ -209,9 +210,10 @@ },

var liveEvents = [];
if (evts && callback) {
for (var i = 0, len = evts.length; i < len; i++) {
if (evts[i].fn !== callback) liveEvents.push(evts[i]);
if (evts[i].fn !== callback && evts[i].fn._ !== callback)
liveEvents.push(evts[i]);
}
}
// Remove event from queue to prevent memory leak

@@ -221,6 +223,6 @@ // Suggested by https://github.com/lazd

(liveEvents.length)
(liveEvents.length)
? e[name] = liveEvents
: delete e[name];
return this;

@@ -227,0 +229,0 @@ }

@@ -1,1 +0,1 @@

!function(t){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=t();else if("function"==typeof define&&define.amd)define([],t);else{var e;e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this,e.ArrayKeys=t()}}(function(){return function t(e,i,n){function r(s,f){if(!i[s]){if(!e[s]){var h="function"==typeof require&&require;if(!f&&h)return h(s,!0);if(o)return o(s,!0);var u=new Error("Cannot find module '"+s+"'");throw u.code="MODULE_NOT_FOUND",u}var d=i[s]={exports:{}};e[s][0].call(d.exports,function(t){var i=e[s][1][t];return r(i?i:t)},d,d.exports,t,e,i,n)}return i[s].exports}for(var o="function"==typeof require&&require,s=0;s<n.length;s++)r(n[s]);return r}({1:[function(t,e,i){function n(t){"object"!=typeof t&&(t={}),this._identifier=t.identifier||"id",this._store=[],this._idx=[],t.emitEvents?(this._emitEvents=!0,this.events=new r):this._emitEvents=!1}var r=t("tiny-emitter");n.prototype.emitEvent=function(t,e,i){this._emitEvents&&!i&&this.events.emit(t,e)},n.prototype.getIdentifiers=function(){for(var t=[],e=this._store.length-1;e>=0;e-=1)t[t.length]=this._store[e][this._identifier];return t},n.prototype.getRecord=function(t){for(var e=this._store.length-1;e>=0;e-=1)if(this._store[e][this._identifier]===t)return this._store[e];return void 0},n.prototype.exists=function(t){return this.getIndex(t)>=0?!0:!1},n.prototype.getIndex=function(t){for(var e=this._idx.length-1;e>=0;e-=1)if(this._idx[e]===t)return e;return-1},n.prototype.addRecord=function(t){if("object"!=typeof t)throw new Error("cannot add non-object records.");if(!t[this._identifier])throw new Error("cannot add a record with no `"+this._identifier+"` property specified.");var e=this.removeRecord(t[this._identifier],!0);return this._idx[this._idx.length]=t[this._identifier],this._store[this._store.length]=t,setTimeout(function(){e?setTimeout(this.emitEvent.bind(this,"update",t),0):setTimeout(this.emitEvent.bind(this,"add",t),0)}.bind(this),0),!0},n.prototype.removeRecord=function(t,e){var i=this.getIndex(t);if(0>i)return!1;for(var n=i;n>=0;n-=1)if(this._store[n]&&this._store[n][this._identifier]===t)return this._store.splice(n,1),this._idx.splice(i,1),setTimeout(this.emitEvent.bind(this,"remove",t,e),0),!0;for(var r=this._store.length-1;r>=i;r-=1)if(this._store[n]&&this._store[r][this._identifier]===t)return this._store.splice(r,1),this._idx.splice(i,1),setTimeout(this.emitEvent.bind(this,"remove",t,e),0),!0;return!1},n.prototype.forEachRecord=function(t){var e=0,i=this,n=function(){};return setTimeout(function(){for(var r=i._store.length-1;r>=0;r-=1)e+=1,setTimeout(t.bind(null,i._store[r]),0);setTimeout(n.bind(null,e),0)},0),{"finally":function(t){n=t}}},n.prototype.getCount=function(){return this._store.length},n.prototype.removeAll=function(){for(var t=this._store.length-1;t>=0;t-=1)delete this._store[t];this._store=[]},e.exports=n},{"tiny-emitter":2}],2:[function(t,e,i){function n(){}n.prototype={on:function(t,e,i){var n=this.e||(this.e={});return(n[t]||(n[t]=[])).push({fn:e,ctx:i}),this},once:function(t,e,i){var n=this,r=function(){n.off(t,r),e.apply(i,arguments)};return this.on(t,r,i)},emit:function(t){var e=[].slice.call(arguments,1),i=((this.e||(this.e={}))[t]||[]).slice(),n=0,r=i.length;for(n;r>n;n++)i[n].fn.apply(i[n].ctx,e);return this},off:function(t,e){var i=this.e||(this.e={}),n=i[t],r=[];if(n&&e)for(var o=0,s=n.length;s>o;o++)n[o].fn!==e&&r.push(n[o]);return r.length?i[t]=r:delete i[t],this}},e.exports=n},{}]},{},[1])(1)});
!function(t){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=t();else if("function"==typeof define&&define.amd)define([],t);else{var e;e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this,e.ArrayKeys=t()}}(function(){return function t(e,i,n){function r(s,f){if(!i[s]){if(!e[s]){var h="function"==typeof require&&require;if(!f&&h)return h(s,!0);if(o)return o(s,!0);var u=new Error("Cannot find module '"+s+"'");throw u.code="MODULE_NOT_FOUND",u}var d=i[s]={exports:{}};e[s][0].call(d.exports,function(t){var i=e[s][1][t];return r(i?i:t)},d,d.exports,t,e,i,n)}return i[s].exports}for(var o="function"==typeof require&&require,s=0;s<n.length;s++)r(n[s]);return r}({1:[function(t,e,i){function n(t){"object"!=typeof t&&(t={}),this._identifier=t.identifier||"id",this._store=[],this._idx=[],t.emitEvents?(this._emitEvents=!0,this.events=new r):this._emitEvents=!1}var r=t("tiny-emitter");n.prototype.emitEvent=function(t,e,i){this._emitEvents&&!i&&this.events.emit(t,e)},n.prototype.getIdentifiers=function(){for(var t=[],e=this._store.length-1;e>=0;e-=1)t[t.length]=this._store[e][this._identifier];return t},n.prototype.getRecord=function(t){for(var e=this._store.length-1;e>=0;e-=1)if(this._store[e][this._identifier]===t)return this._store[e]},n.prototype.exists=function(t){return this.getIndex(t)>=0},n.prototype.getIndex=function(t){for(var e=this._idx.length-1;e>=0;e-=1)if(this._idx[e]===t)return e;return-1},n.prototype.addRecord=function(t){if("object"!=typeof t)throw new Error("cannot add non-object records.");if(!t[this._identifier])throw new Error("cannot add a record with no `"+this._identifier+"` property specified.");var e=this.removeRecord(t[this._identifier],!0);return this._idx[this._idx.length]=t[this._identifier],this._store[this._store.length]=t,setTimeout(function(){e?setTimeout(this.emitEvent.bind(this,"update",t),0):setTimeout(this.emitEvent.bind(this,"add",t),0)}.bind(this),0),!0},n.prototype.removeRecord=function(t,e){var i=this.getIndex(t);if(i<0)return!1;for(var n=i;n>=0;n-=1)if(this._store[n]&&this._store[n][this._identifier]===t)return this._store.splice(n,1),this._idx.splice(i,1),setTimeout(this.emitEvent.bind(this,"remove",t,e),0),!0;for(var r=this._store.length-1;r>=i;r-=1)if(this._store[n]&&this._store[r][this._identifier]===t)return this._store.splice(r,1),this._idx.splice(i,1),setTimeout(this.emitEvent.bind(this,"remove",t,e),0),!0;return!1},n.prototype.forEachRecord=function(t){var e=0,i=this,n=function(){};return setTimeout(function(){for(var r=i._store.length-1;r>=0;r-=1)e+=1,setTimeout(t.bind(null,i._store[r],r),0);setTimeout(n.bind(null,e),0)},0),{"finally":function(t){n=t}}},n.prototype.getCount=function(){return this._store.length},n.prototype.removeAll=function(){for(var t=this._store.length-1;t>=0;t-=1)delete this._store[t];this._store=[]},e.exports=n},{"tiny-emitter":2}],2:[function(t,e,i){function n(){}n.prototype={on:function(t,e,i){var n=this.e||(this.e={});return(n[t]||(n[t]=[])).push({fn:e,ctx:i}),this},once:function(t,e,i){function n(){r.off(t,n),e.apply(i,arguments)}var r=this;return n._=e,this.on(t,n,i)},emit:function(t){var e=[].slice.call(arguments,1),i=((this.e||(this.e={}))[t]||[]).slice(),n=0,r=i.length;for(n;n<r;n++)i[n].fn.apply(i[n].ctx,e);return this},off:function(t,e){var i=this.e||(this.e={}),n=i[t],r=[];if(n&&e)for(var o=0,s=n.length;o<s;o++)n[o].fn!==e&&n[o].fn._!==e&&r.push(n[o]);return r.length?i[t]=r:delete i[t],this}},e.exports=n},{}]},{},[1])(1)});
/*!
* array-keys
* version 2.1.3
* version 2.2.0
* http://github.com/silverbucket/array-keys

@@ -132,3 +132,3 @@ *

count += 1;
setTimeout(cb.bind(null, self._store[i]), 0);
setTimeout(cb.bind(null, self._store[i], i), 0);
}

@@ -135,0 +135,0 @@ setTimeout(finished.bind(null, count), 0);

{
"name": "array-keys",
"version": "2.1.3",
"version": "2.2.0",
"description": "a simple interface to manage large arrays of objects easily",

@@ -20,7 +20,7 @@ "license": "MIT",

"browserify": "^10.2.4",
"gulp": "^3.9.0",
"gulp": "^3.9.1",
"gulp-rename": "^1.2.0",
"gulp-streamify": "0.0.5",
"gulp-uglify": "^1.1.0",
"jaribu": "^2.0.0",
"gulp-uglify": "^1.5.4",
"jaribu": "^2.2.1",
"vinyl-source-stream": "^1.1.0"

@@ -41,4 +41,4 @@ },

"dependencies": {
"tiny-emitter": "^1.0.0"
"tiny-emitter": "^1.1.0"
}
}
SocketSocket SOC 2 Logo

Product

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

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc