Huge News!Announcing our $40M Series B led by Abstract Ventures.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 1.2.2 to 1.2.3

4

array-keys.js
/*!
* array-keys
* version 1.2.2
* version 1.2.3
* http://github.com/silverbucket/array-keys

@@ -53,3 +53,3 @@ *

ArrayKeys.prototype.getIndex = function (id) {
for (i = this.idx.length - 1; i >= 0; i = i - 1) {
for (var i = this.idx.length - 1; i >= 0; i = i - 1) {
if (this.idx[i] === id) {

@@ -56,0 +56,0 @@ return i;

!function(e){if("object"==typeof exports)module.exports=e();else if("function"==typeof define&&define.amd)define(e);else{var f;"undefined"!=typeof window?f=window:"undefined"!=typeof global?f=global:"undefined"!=typeof self&&(f=self),f.ArrayKeys=e()}}(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);throw new Error("Cannot find module '"+o+"'")}var f=n[o]={exports:{}};t[o][0].call(f.exports,function(e){var n=t[o][1][e];return s(n?n:e)},f,f.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(_dereq_,module,exports){
/*!
* array-keys
* version 1.2.2
* version 1.2.3
* http://github.com/silverbucket/array-keys

@@ -54,3 +54,3 @@ *

ArrayKeys.prototype.getIndex = function (id) {
for (i = this.idx.length - 1; i >= 0; i = i - 1) {
for (var i = this.idx.length - 1; i >= 0; i = i - 1) {
if (this.idx[i] === id) {

@@ -57,0 +57,0 @@ return i;

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

!function(t){if("object"==typeof exports)module.exports=t();else if("function"==typeof define&&define.amd)define(t);else{var e;"undefined"!=typeof window?e=window:"undefined"!=typeof global?e=global:"undefined"!=typeof self&&(e=self),e.ArrayKeys=t()}}(function(){return function t(e,i,r){function n(f,s){if(!i[f]){if(!e[f]){var d="function"==typeof require&&require;if(!s&&d)return d(f,!0);if(o)return o(f,!0);throw new Error("Cannot find module '"+f+"'")}var u=i[f]={exports:{}};e[f][0].call(u.exports,function(t){var i=e[f][1][t];return n(i?i:t)},u,u.exports,t,e,i,r)}return i[f].exports}for(var o="function"==typeof require&&require,f=0;f<r.length;f++)n(r[f]);return n}({1:[function(t,e){function r(t){"object"!=typeof t&&(t={}),this.identifier=t.identifier||"id",this.store=[],this.idx=[]}r.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},r.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},r.prototype.exists=function(t){return this.getIndex(t)>=0?!0:!1},r.prototype.getIndex=function(t){for(i=this.idx.length-1;i>=0;i-=1)if(this.idx[i]===t)return i;return-1},r.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.");return this.removeRecord(t[this.identifier]),this.idx[this.idx.length]=t[this.identifier],this.store[this.store.length]=t,!0},r.prototype.removeRecord=function(t){var e=this.getIndex(t);if(0>e)return!1;var i;for(i=e;0!==i;i-=1)if(this.store[i][this.identifier]===t)return this.store.splice(i,1),this.idx.splice(e,1),!0;for(i=this.store.length-1;i!==e;i-=1)if(this.store[i][this.identifier]===t)return this.store.splice(i,1),this.idx.splice(e,1),!0;return!1},r.prototype.forEachRecord=function(t){var e=0,i=this,r=function(){};return setTimeout(function(){for(var n=i.store.length-1;n>=0;n-=1)e+=1,t(i.store[n]);r(e)},0),{"finally":function(t){r=t}}},r.prototype.getCount=function(){return this.store.length},e.exports=r},{}]},{},[1])(1)});
!function(t){if("object"==typeof exports)module.exports=t();else if("function"==typeof define&&define.amd)define(t);else{var e;"undefined"!=typeof window?e=window:"undefined"!=typeof global?e=global:"undefined"!=typeof self&&(e=self),e.ArrayKeys=t()}}(function(){return function t(e,r,i){function n(f,s){if(!r[f]){if(!e[f]){var d="function"==typeof require&&require;if(!s&&d)return d(f,!0);if(o)return o(f,!0);throw new Error("Cannot find module '"+f+"'")}var u=r[f]={exports:{}};e[f][0].call(u.exports,function(t){var r=e[f][1][t];return n(r?r:t)},u,u.exports,t,e,r,i)}return r[f].exports}for(var o="function"==typeof require&&require,f=0;f<i.length;f++)n(i[f]);return n}({1:[function(t,e){function r(t){"object"!=typeof t&&(t={}),this.identifier=t.identifier||"id",this.store=[],this.idx=[]}r.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},r.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},r.prototype.exists=function(t){return this.getIndex(t)>=0?!0:!1},r.prototype.getIndex=function(t){for(var e=this.idx.length-1;e>=0;e-=1)if(this.idx[e]===t)return e;return-1},r.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.");return this.removeRecord(t[this.identifier]),this.idx[this.idx.length]=t[this.identifier],this.store[this.store.length]=t,!0},r.prototype.removeRecord=function(t){var e=this.getIndex(t);if(0>e)return!1;var r;for(r=e;0!==r;r-=1)if(this.store[r][this.identifier]===t)return this.store.splice(r,1),this.idx.splice(e,1),!0;for(r=this.store.length-1;r!==e;r-=1)if(this.store[r][this.identifier]===t)return this.store.splice(r,1),this.idx.splice(e,1),!0;return!1},r.prototype.forEachRecord=function(t){var e=0,r=this,i=function(){};return setTimeout(function(){for(var n=r.store.length-1;n>=0;n-=1)e+=1,t(r.store[n]);i(e)},0),{"finally":function(t){i=t}}},r.prototype.getCount=function(){return this.store.length},e.exports=r},{}]},{},[1])(1)});
{
"name": "array-keys",
"version": "1.2.2",
"version": "1.2.3",
"description": "a simple interface to manage large arrays of objects easily",
"license": "LGPL",
"license": "MIT",
"private": false,

@@ -7,0 +7,0 @@ "keywords": [

Sorry, the diff of this file is not supported yet

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