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

@mirohq/design-system-use-local-storage

Package Overview
Dependencies
Maintainers
2
Versions
21
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@mirohq/design-system-use-local-storage - npm Package Compare versions

Comparing version 0.3.1 to 0.3.2

17

dist/main.js

@@ -11,2 +11,5 @@ 'use strict';

function getLocalStorageValue(key, defaultValue) {
if (typeof window === "undefined") {
return defaultValue;
}
try {

@@ -17,3 +20,3 @@ const stored = window.localStorage.getItem(key);

console.error(
"[useLocalStorage] Error reading localStorage key \u201C".concat(key, "\u201D:"),
`[useLocalStorage] Error reading localStorage key \u201C${key}\u201D:`,
e

@@ -25,2 +28,5 @@ );

function setLocalStorageValue(key, value) {
if (typeof window === "undefined") {
return;
}
try {

@@ -30,3 +36,3 @@ window.localStorage.setItem(key, JSON.stringify(value));

console.error(
"[useLocalStorage] Error setting localStorage key \u201C".concat(key, "\u201D:"),
`[useLocalStorage] Error setting localStorage key \u201C${key}\u201D:`,
e

@@ -37,2 +43,5 @@ );

function removeLocalStorageValue(key) {
if (typeof window === "undefined") {
return;
}
try {

@@ -42,3 +51,3 @@ window.localStorage.removeItem(key);

console.error(
"[useLocalStorage] Error removing localStorage key \u201C".concat(key, "\u201D:"),
`[useLocalStorage] Error removing localStorage key \u201C${key}\u201D:`,
e

@@ -50,3 +59,3 @@ );

const prefixedKey = react.useMemo(
() => "".concat(prefix != null ? prefix : KEY_PREFIX, "_").concat(key),
() => `${prefix != null ? prefix : KEY_PREFIX}_${key}`,
[prefix, key]

@@ -53,0 +62,0 @@ );

@@ -7,2 +7,5 @@ import { useEventListener } from '@mirohq/design-system-use-event-listener';

function getLocalStorageValue(key, defaultValue) {
if (typeof window === "undefined") {
return defaultValue;
}
try {

@@ -13,3 +16,3 @@ const stored = window.localStorage.getItem(key);

console.error(
"[useLocalStorage] Error reading localStorage key \u201C".concat(key, "\u201D:"),
`[useLocalStorage] Error reading localStorage key \u201C${key}\u201D:`,
e

@@ -21,2 +24,5 @@ );

function setLocalStorageValue(key, value) {
if (typeof window === "undefined") {
return;
}
try {

@@ -26,3 +32,3 @@ window.localStorage.setItem(key, JSON.stringify(value));

console.error(
"[useLocalStorage] Error setting localStorage key \u201C".concat(key, "\u201D:"),
`[useLocalStorage] Error setting localStorage key \u201C${key}\u201D:`,
e

@@ -33,2 +39,5 @@ );

function removeLocalStorageValue(key) {
if (typeof window === "undefined") {
return;
}
try {

@@ -38,3 +47,3 @@ window.localStorage.removeItem(key);

console.error(
"[useLocalStorage] Error removing localStorage key \u201C".concat(key, "\u201D:"),
`[useLocalStorage] Error removing localStorage key \u201C${key}\u201D:`,
e

@@ -46,3 +55,3 @@ );

const prefixedKey = useMemo(
() => "".concat(prefix != null ? prefix : KEY_PREFIX, "_").concat(key),
() => `${prefix != null ? prefix : KEY_PREFIX}_${key}`,
[prefix, key]

@@ -49,0 +58,0 @@ );

{
"name": "@mirohq/design-system-use-local-storage",
"version": "0.3.1",
"version": "0.3.2",
"description": "",

@@ -29,4 +29,4 @@ "author": "Miro",

"@mirohq/design-system-types": "^0.6.0",
"@mirohq/design-system-use-event-listener": "^0.3.0",
"@mirohq/design-system-use-event": "^0.2.0"
"@mirohq/design-system-use-event": "^0.2.0",
"@mirohq/design-system-use-event-listener": "^0.3.0"
},

@@ -33,0 +33,0 @@ "scripts": {

Sorry, the diff of this file is not supported yet

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