@jmondi/browser-storage
Advanced tools
Comparing version 1.6.2 to 1.6.3
@@ -36,3 +36,4 @@ export class BrowserStorage { | ||
} | ||
catch { } | ||
catch { | ||
} | ||
return false; | ||
@@ -83,3 +84,8 @@ } | ||
constructor(config = {}) { | ||
super({ ...config, adapter: globalThis.localStorage }); | ||
let adapter = globalThis.localStorage; | ||
if (!(adapter instanceof Storage)) { | ||
adapter = new MemoryStorageAdapter(); | ||
console.log("[@jmondi/browser-storage] window.localStorage is unavailable, falling back to an in memory storage adapter"); | ||
} | ||
super({ ...config, adapter }); | ||
} | ||
@@ -89,3 +95,8 @@ } | ||
constructor(config = {}) { | ||
super({ ...config, adapter: globalThis.sessionStorage }); | ||
let adapter = globalThis.sessionStorage; | ||
if (!(adapter instanceof Storage)) { | ||
adapter = new MemoryStorageAdapter(); | ||
console.log("[@jmondi/browser-storage] window.sessionStorage is unavailable, falling back to an in memory storage adapter"); | ||
} | ||
super({ ...config, adapter }); | ||
} | ||
@@ -121,4 +132,4 @@ } | ||
super(); | ||
console.log("MemoryStorageProvider is deprecated, use MemoryStorageAdapter instead"); | ||
console.log("[@jmondi/browser-storage] MemoryStorageProvider is deprecated, use MemoryStorageAdapter instead"); | ||
} | ||
} |
@@ -5,3 +5,3 @@ { | ||
"name": "@jmondi/browser-storage", | ||
"version": "1.6.2", | ||
"version": "1.6.3", | ||
"description": "Utilities for local and session browser storage.", | ||
@@ -8,0 +8,0 @@ "keywords": [ |
@@ -39,3 +39,4 @@ "use strict"; | ||
} | ||
catch { } | ||
catch { | ||
} | ||
return false; | ||
@@ -87,3 +88,8 @@ } | ||
constructor(config = {}) { | ||
super({ ...config, adapter: globalThis.localStorage }); | ||
let adapter = globalThis.localStorage; | ||
if (!(adapter instanceof Storage)) { | ||
adapter = new MemoryStorageAdapter(); | ||
console.log("[@jmondi/browser-storage] window.localStorage is unavailable, falling back to an in memory storage adapter"); | ||
} | ||
super({ ...config, adapter }); | ||
} | ||
@@ -94,3 +100,8 @@ } | ||
constructor(config = {}) { | ||
super({ ...config, adapter: globalThis.sessionStorage }); | ||
let adapter = globalThis.sessionStorage; | ||
if (!(adapter instanceof Storage)) { | ||
adapter = new MemoryStorageAdapter(); | ||
console.log("[@jmondi/browser-storage] window.sessionStorage is unavailable, falling back to an in memory storage adapter"); | ||
} | ||
super({ ...config, adapter }); | ||
} | ||
@@ -128,5 +139,5 @@ } | ||
super(); | ||
console.log("MemoryStorageProvider is deprecated, use MemoryStorageAdapter instead"); | ||
console.log("[@jmondi/browser-storage] MemoryStorageProvider is deprecated, use MemoryStorageAdapter instead"); | ||
} | ||
} | ||
exports.MemoryStorageProvider = MemoryStorageProvider; |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
19111
412