Socket
Socket
Sign inDemoInstall

cart-localstorage

Package Overview
Dependencies
0
Maintainers
1
Versions
15
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 1.0.4 to 1.0.5

8

dist/index.js

@@ -7,2 +7,3 @@ var cartLS = (function (exports) {

let saveListener = null;
const listen = (cb) => { saveListener = cb; }; // ugly but storage listener is not working for the same window..

@@ -16,6 +17,7 @@ const get = (key) => JSON.parse(localStorage.getItem(key || STORAGE_KEY)) || [];

const clear = () => localStorage.removeItem(STORAGE_KEY);
const clear = () => {
localStorage.removeItem(STORAGE_KEY);
if(saveListener) saveListener(get(key || STORAGE_KEY));
};
const listen = (cb) => { saveListener = cb; }; // ugly but storage listener is not working for the same window..
const list = () => get();

@@ -22,0 +24,0 @@

{
"name": "cart-localstorage",
"version": "1.0.4",
"version": "1.0.5",
"description": "Tiny shopping cart on top of LolcalStorage - ES6, < 1Kb, test coverage",

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

@@ -13,3 +13,5 @@ const STORAGE_KEY = '__cart'

export const clear = () => localStorage.removeItem(STORAGE_KEY)
export const clear = () => {
localStorage.removeItem(STORAGE_KEY)
if(saveListener) saveListener(get(key || STORAGE_KEY))
}

Sorry, the diff of this file is not supported yet

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