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

svelte-local-storage-store

Package Overview
Dependencies
Maintainers
1
Versions
24
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

svelte-local-storage-store - npm Package Compare versions

Comparing version 0.1.3 to 0.1.4

13

dist/index.js

@@ -85,5 +85,12 @@ (function (global, factory) {

function updateStorage(key, value) {
if (typeof(localStorage) == 'undefined')
return
localStorage.setItem(key, JSON.stringify(value));
}
return {
set(value) {
typeof(localStorage) != 'undefined' ? localStorage.setItem(key, JSON.stringify(value)) : null;
updateStorage(key, value);
set(value);

@@ -93,3 +100,5 @@ },

const value = cb(get_store_value(store));
this.set(value);
updateStorage(key, value);
set(value);
},

@@ -96,0 +105,0 @@ subscribe

{
"name": "svelte-local-storage-store",
"version": "0.1.3",
"version": "0.1.4",
"svelte": "src/index.js",

@@ -10,8 +10,25 @@ "module": "dist/index.mjs",

"prepublishOnly": "npm run build",
"lint": "eslint . --ext .js,.svelte"
"lint": "eslint . --ext .js,.svelte",
"test": "jest",
"test:watch": "yarn run test -- --watch"
},
"jest": {
"testMatch": [
"<rootDir>/test/*.test.js"
],
"transform": {
"^.+\\.js$": "babel-jest"
},
"moduleFileExtensions": [
"js"
]
},
"devDependencies": {
"@babel/preset-env": "^7.11.5",
"@rollup/plugin-node-resolve": "^6.0.0",
"babel-jest": "^26.5.2",
"eslint": "^7.3.1",
"eslint-plugin-jest": "^24.1.0",
"eslint-plugin-svelte3": "^2.7.3",
"jest": "^26.5.2",
"rollup": "^2.18.0",

@@ -18,0 +35,0 @@ "rollup-plugin-svelte": "^5.0.0",

1

README.md

@@ -43,3 +43,2 @@ # svelte-local-storage-store

- [ ] Support multiple tabs / capture event when localStorage changes
- [ ] Add tests

@@ -46,0 +45,0 @@ ## License

@@ -12,5 +12,12 @@ import {writable as internal, get} from 'svelte/store'

function updateStorage(key, value) {
if (typeof(localStorage) == 'undefined')
return
localStorage.setItem(key, JSON.stringify(value))
}
return {
set(value) {
typeof(localStorage) != 'undefined' ? localStorage.setItem(key, JSON.stringify(value)) : null
updateStorage(key, value)
set(value)

@@ -20,3 +27,5 @@ },

const value = cb(get(store))
this.set(value)
updateStorage(key, value)
set(value)
},

@@ -23,0 +32,0 @@ subscribe

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