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

storeit

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

storeit - npm Package Compare versions

Comparing version 2.0.1 to 2.1.0

24

lib/Storeit.js

@@ -23,3 +23,3 @@ "use strict";

var events = ["added", "modified", "removed", "cleared"];
var events = ["added", "modified", "removed", "cleared", "ready"];
var EventName = _.object(events, events);

@@ -60,2 +60,14 @@

function isInitialized() {
return throwIfUninitialized !== throwUninitializedError;
}
function initialize() {
var needsInitialization = !isInitialized();
if (needsInitialization) {
throwIfUninitialized = _.noop; // Allow other methods to work without throwing.
}
return needsInitialization;
}
function addEvent(eventName) {

@@ -211,3 +223,3 @@ if (!Storeit.EventName[eventName]) {

that.clear = function () {
throwIfUninitialized = _.noop; // Allow other methods to work without throwing.
var publishReady = initialize(); // Initialize only if needed and return true if initalization was performed.
getIndex().forEach(function (key) { // Remove everything from provider, loaded or not.

@@ -222,2 +234,5 @@ storageProvider.removeItem(nskey(key));

publish(EventName.cleared);
if (publishReady) {
originalPublish(EventName.ready);
}
};

@@ -238,5 +253,3 @@

Object.defineProperty(that, "isInitialized", {
get: function () {
return throwIfUninitialized !== throwUninitializedError;
},
get: isInitialized,
enumerable: true

@@ -258,2 +271,3 @@ });

});
originalPublish(EventName.ready); // Publish even if options.publish is false.
};

@@ -260,0 +274,0 @@

{
"name": "storeit",
"version": "2.0.1",
"version": "2.1.0",
"description": "A key/value storage system that publishes events.",

@@ -5,0 +5,0 @@ "main": "./lib/Storeit.js",

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