Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

collectionize

Package Overview
Dependencies
Maintainers
1
Versions
21
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

collectionize - npm Package Compare versions

Comparing version 1.0.0 to 1.0.1

27

collectionize.js

@@ -73,3 +73,3 @@ (function () {

self.name = name; // Used for localStorage property naming.
self.idIndex = [];
self.idIndex = {};

@@ -173,8 +173,25 @@ nativeEach(LODASH_METHODS, function (methodName) {

}
_addToIndex(obj);
self.trigger('updated', match);
}
function _addToIndex(obj) {
if (obj && obj.id) {
self.idIndex[obj.id + ''] = obj;
}
self.trigger('updated', match);
}
function _removeFromIndex(obj) {
if (obj && obj.id) {
self.idIndex[obj.id + ''] = null;
}
}
function _resetIndex() {
self.idIndex = {};
self.each(function (obj) {
_addToIndex(obj);
});
}
self.getById = function (id) {

@@ -200,5 +217,3 @@ return self.idIndex[id + ''];

nativeEach(removed, function (obj) {
if (obj && obj.id) {
self.idIndex[obj.id + ''] = null;
}
_removeFromIndex(obj);
self.trigger('removed', obj);

@@ -211,3 +226,3 @@ });

self.db = db || [];
self.idIndex = [];
_resetIndex();
self.trigger('flushed');

@@ -214,0 +229,0 @@ };

{
"name": "collectionize",
"description": "A lightweight JS model/collection library.",
"version": "1.0.0",
"version": "1.0.1",
"repository": "https://github.com/andrewchilds/collectionize.git",

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

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