From 0f85ddd4915ce442f39bd1a4a14c11eb0873a506 Mon Sep 17 00:00:00 2001 From: Ian K Smith Date: Sat, 9 Nov 2019 16:22:49 -0500 Subject: [PATCH 1/2] Fix web storage feature detect --- src/lib.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/lib.ts b/src/lib.ts index 0c31b1d..ef44879 100644 --- a/src/lib.ts +++ b/src/lib.ts @@ -245,9 +245,9 @@ export const StorageProxy = { throw new TypeError(`[storage-target] Expected \`WebStorage\` target to be one of: ('${StorageTarget.Local}', '${StorageTarget.Session}')`); } - const storage = window[storageTarget]; - + let storage: any; try { + storage = window[storageTarget]; const x = '__storage_test__'; storage.setItem(x, x); storage.removeItem(x); From 0825340a1c5c3c5e434aa94037d88534cd07b83f Mon Sep 17 00:00:00 2001 From: Ian K Smith Date: Sat, 9 Nov 2019 16:23:21 -0500 Subject: [PATCH 2/2] v1.1.1 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index c8fbc54..dffe5e2 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "storage-proxy", - "version": "1.1.0", + "version": "1.1.1", "description": "Use web storage (localStorage/sessionStorage) just like plain objects using ES6 Proxies.", "author": "Ian K Smith ", "license": "MIT",