@walletconnect/keyvaluestorage
Advanced tools
Comparing version 1.0.1-rc.1-1c715f7f to 1.0.2
@@ -5,4 +5,4 @@ "use strict"; | ||
const tslib_1 = require("tslib"); | ||
const localStorage_1 = tslib_1.__importDefault(require("localStorage")); | ||
const safe_json_utils_1 = require("safe-json-utils"); | ||
const localStorage_1 = tslib_1.__importDefault(require("./lib/localStorage")); | ||
const shared_1 = require("../shared"); | ||
@@ -9,0 +9,0 @@ class KeyValueStorage { |
@@ -27,3 +27,3 @@ "use strict"; | ||
const item = yield this.asyncStorage.getItem(key); | ||
if (typeof item == "undefined" || item === null) { | ||
if (typeof item === "undefined" || item === null) { | ||
return undefined; | ||
@@ -30,0 +30,0 @@ } |
@@ -1,3 +0,3 @@ | ||
import localStorage from "localStorage"; | ||
import { safeJsonParse, safeJsonStringify } from "safe-json-utils"; | ||
import localStorage from "./lib/localStorage"; | ||
import { parseEntry } from "../shared"; | ||
@@ -4,0 +4,0 @@ export class KeyValueStorage { |
@@ -18,3 +18,3 @@ import AsyncStorage from "@react-native-async-storage/async-storage"; | ||
const item = await this.asyncStorage.getItem(key); | ||
if (typeof item == "undefined" || item === null) { | ||
if (typeof item === "undefined" || item === null) { | ||
return undefined; | ||
@@ -21,0 +21,0 @@ } |
@@ -1,2 +0,2 @@ | ||
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define("KeyValueStorage",[],e):"object"==typeof exports?exports.KeyValueStorage=e():t.KeyValueStorage=e()}(this,(function(){return function(t){var e={};function n(r){if(e[r])return e[r].exports;var o=e[r]={i:r,l:!1,exports:{}};return t[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}return n.m=t,n.c=e,n.d=function(t,e,r){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:r})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var o in t)n.d(r,o,function(e){return t[e]}.bind(null,o));return r},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s=2)}([function(t,e,n){"use strict";n.r(e),n.d(e,"__extends",(function(){return o})),n.d(e,"__assign",(function(){return i})),n.d(e,"__rest",(function(){return u})),n.d(e,"__decorate",(function(){return a})),n.d(e,"__param",(function(){return c})),n.d(e,"__metadata",(function(){return f})),n.d(e,"__awaiter",(function(){return l})),n.d(e,"__generator",(function(){return s})),n.d(e,"__createBinding",(function(){return p})),n.d(e,"__exportStar",(function(){return y})),n.d(e,"__values",(function(){return d})),n.d(e,"__read",(function(){return _})),n.d(e,"__spread",(function(){return h})),n.d(e,"__spreadArrays",(function(){return v})),n.d(e,"__await",(function(){return b})),n.d(e,"__asyncGenerator",(function(){return g})),n.d(e,"__asyncDelegator",(function(){return m})),n.d(e,"__asyncValues",(function(){return w})),n.d(e,"__makeTemplateObject",(function(){return S})),n.d(e,"__importStar",(function(){return O})),n.d(e,"__importDefault",(function(){return j})),n.d(e,"__classPrivateFieldGet",(function(){return P})),n.d(e,"__classPrivateFieldSet",(function(){return x})); | ||
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define("KeyValueStorage",[],e):"object"==typeof exports?exports.KeyValueStorage=e():t.KeyValueStorage=e()}(this,(function(){return function(t){var e={};function n(r){if(e[r])return e[r].exports;var o=e[r]={i:r,l:!1,exports:{}};return t[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}return n.m=t,n.c=e,n.d=function(t,e,r){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:r})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var o in t)n.d(r,o,function(e){return t[e]}.bind(null,o));return r},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s=2)}([function(t,e,n){"use strict";n.r(e),n.d(e,"__extends",(function(){return o})),n.d(e,"__assign",(function(){return i})),n.d(e,"__rest",(function(){return u})),n.d(e,"__decorate",(function(){return a})),n.d(e,"__param",(function(){return c})),n.d(e,"__metadata",(function(){return f})),n.d(e,"__awaiter",(function(){return l})),n.d(e,"__generator",(function(){return s})),n.d(e,"__createBinding",(function(){return p})),n.d(e,"__exportStar",(function(){return y})),n.d(e,"__values",(function(){return d})),n.d(e,"__read",(function(){return _})),n.d(e,"__spread",(function(){return h})),n.d(e,"__spreadArrays",(function(){return v})),n.d(e,"__await",(function(){return b})),n.d(e,"__asyncGenerator",(function(){return w})),n.d(e,"__asyncDelegator",(function(){return g})),n.d(e,"__asyncValues",(function(){return m})),n.d(e,"__makeTemplateObject",(function(){return S})),n.d(e,"__importStar",(function(){return O})),n.d(e,"__importDefault",(function(){return j})),n.d(e,"__classPrivateFieldGet",(function(){return P})),n.d(e,"__classPrivateFieldSet",(function(){return x})); | ||
/*! ***************************************************************************** | ||
@@ -16,2 +16,2 @@ Copyright (c) Microsoft Corporation. | ||
***************************************************************************** */ | ||
var r=function(t,e){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)};function o(t,e){function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}var i=function(){return(i=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)};function u(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(t);o<r.length;o++)e.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(t,r[o])&&(n[r[o]]=t[r[o]])}return n}function a(t,e,n,r){var o,i=arguments.length,u=i<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)u=Reflect.decorate(t,e,n,r);else for(var a=t.length-1;a>=0;a--)(o=t[a])&&(u=(i<3?o(u):i>3?o(e,n,u):o(e,n))||u);return i>3&&u&&Object.defineProperty(e,n,u),u}function c(t,e){return function(n,r){e(n,r,t)}}function f(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)}function l(t,e,n,r){return new(n||(n=Promise))((function(o,i){function u(t){try{c(r.next(t))}catch(t){i(t)}}function a(t){try{c(r.throw(t))}catch(t){i(t)}}function c(t){var e;t.done?o(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(u,a)}c((r=r.apply(t,e||[])).next())}))}function s(t,e){var n,r,o,i,u={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(i){return function(a){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;u;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return u.label++,{value:i[1],done:!1};case 5:u.label++,r=i[1],i=[0];continue;case 7:i=u.ops.pop(),u.trys.pop();continue;default:if(!(o=u.trys,(o=o.length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){u=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){u.label=i[1];break}if(6===i[0]&&u.label<o[1]){u.label=o[1],o=i;break}if(o&&u.label<o[2]){u.label=o[2],u.ops.push(i);break}o[2]&&u.ops.pop(),u.trys.pop();continue}i=e.call(t,u)}catch(t){i=[6,t],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,a])}}}function p(t,e,n,r){void 0===r&&(r=n),t[r]=e[n]}function y(t,e){for(var n in t)"default"===n||e.hasOwnProperty(n)||(e[n]=t[n])}function d(t){var e="function"==typeof Symbol&&Symbol.iterator,n=e&&t[e],r=0;if(n)return n.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function _(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,o,i=n.call(t),u=[];try{for(;(void 0===e||e-- >0)&&!(r=i.next()).done;)u.push(r.value)}catch(t){o={error:t}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return u}function h(){for(var t=[],e=0;e<arguments.length;e++)t=t.concat(_(arguments[e]));return t}function v(){for(var t=0,e=0,n=arguments.length;e<n;e++)t+=arguments[e].length;var r=Array(t),o=0;for(e=0;e<n;e++)for(var i=arguments[e],u=0,a=i.length;u<a;u++,o++)r[o]=i[u];return r}function b(t){return this instanceof b?(this.v=t,this):new b(t)}function g(t,e,n){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var r,o=n.apply(t,e||[]),i=[];return r={},u("next"),u("throw"),u("return"),r[Symbol.asyncIterator]=function(){return this},r;function u(t){o[t]&&(r[t]=function(e){return new Promise((function(n,r){i.push([t,e,n,r])>1||a(t,e)}))})}function a(t,e){try{(n=o[t](e)).value instanceof b?Promise.resolve(n.value.v).then(c,f):l(i[0][2],n)}catch(t){l(i[0][3],t)}var n}function c(t){a("next",t)}function f(t){a("throw",t)}function l(t,e){t(e),i.shift(),i.length&&a(i[0][0],i[0][1])}}function m(t){var e,n;return e={},r("next"),r("throw",(function(t){throw t})),r("return"),e[Symbol.iterator]=function(){return this},e;function r(r,o){e[r]=t[r]?function(e){return(n=!n)?{value:b(t[r](e)),done:"return"===r}:o?o(e):e}:o}}function w(t){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var e,n=t[Symbol.asyncIterator];return n?n.call(t):(t=d(t),e={},r("next"),r("throw"),r("return"),e[Symbol.asyncIterator]=function(){return this},e);function r(n){e[n]=t[n]&&function(e){return new Promise((function(r,o){(function(t,e,n,r){Promise.resolve(r).then((function(e){t({value:e,done:n})}),e)})(r,o,(e=t[n](e)).done,e.value)}))}}}function S(t,e){return Object.defineProperty?Object.defineProperty(t,"raw",{value:e}):t.raw=e,t}function O(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)Object.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e.default=t,e}function j(t){return t&&t.__esModule?t:{default:t}}function P(t,e){if(!e.has(t))throw new TypeError("attempted to get private field on non-instance");return e.get(t)}function x(t,e,n){if(!e.has(t))throw new TypeError("attempted to set private field on non-instance");return e.set(t,n),n}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.safeJsonParse=function(t){if("string"!=typeof t)throw new Error("Cannot safe json parse value of type "+typeof t);try{return JSON.parse(t)}catch(e){return t}},e.safeJsonStringify=function(t){return"string"==typeof t?t:JSON.stringify(t,(t,e)=>void 0===e?null:e)}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.KeyValueStorage=void 0;const r=n(0),o=r.__importDefault(n(3)),i=n(1),u=n(5);class a{constructor(){this.localStorage=o.default}getKeys(){return r.__awaiter(this,void 0,void 0,(function*(){return Object.keys(this.localStorage)}))}getEntries(){return r.__awaiter(this,void 0,void 0,(function*(){return Object.entries(this.localStorage).map(u.parseEntry)}))}getItem(t){return r.__awaiter(this,void 0,void 0,(function*(){const e=this.localStorage.getItem(t);if(null!==e)return i.safeJsonParse(e)}))}setItem(t,e){return r.__awaiter(this,void 0,void 0,(function*(){this.localStorage.setItem(t,i.safeJsonStringify(e))}))}removeItem(t){return r.__awaiter(this,void 0,void 0,(function*(){this.localStorage.removeItem(t)}))}}e.KeyValueStorage=a,e.default=a},function(t,e,n){(function(e){!function(){"use strict";var n;function r(){}(n=r).prototype.getItem=function(t){return this.hasOwnProperty(t)?String(this[t]):null},n.prototype.setItem=function(t,e){this[t]=String(e)},n.prototype.removeItem=function(t){delete this[t]},n.prototype.clear=function(){var t=this;Object.keys(t).forEach((function(e){t[e]=void 0,delete t[e]}))},n.prototype.key=function(t){return t=t||0,Object.keys(this)[t]},n.prototype.__defineGetter__("length",(function(){return Object.keys(this).length})),e.localStorage?t.exports=localStorage:t.exports=new r}()}).call(this,n(4))},function(t,e){var n;n=function(){return this}();try{n=n||new Function("return this")()}catch(t){"object"==typeof window&&(n=window)}t.exports=n},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});const r=n(0);r.__exportStar(n(6),e),r.__exportStar(n(7),e)},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.IKeyValueStorage=void 0;e.IKeyValueStorage=class{}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.parseEntry=void 0;const r=n(1);e.parseEntry=function(t){var e;return[t[0],r.safeJsonParse(null!==(e=t[1])&&void 0!==e?e:"")]}}])})); | ||
var r=function(t,e){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)};function o(t,e){function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}var i=function(){return(i=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)};function u(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(t);o<r.length;o++)e.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(t,r[o])&&(n[r[o]]=t[r[o]])}return n}function a(t,e,n,r){var o,i=arguments.length,u=i<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)u=Reflect.decorate(t,e,n,r);else for(var a=t.length-1;a>=0;a--)(o=t[a])&&(u=(i<3?o(u):i>3?o(e,n,u):o(e,n))||u);return i>3&&u&&Object.defineProperty(e,n,u),u}function c(t,e){return function(n,r){e(n,r,t)}}function f(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)}function l(t,e,n,r){return new(n||(n=Promise))((function(o,i){function u(t){try{c(r.next(t))}catch(t){i(t)}}function a(t){try{c(r.throw(t))}catch(t){i(t)}}function c(t){var e;t.done?o(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(u,a)}c((r=r.apply(t,e||[])).next())}))}function s(t,e){var n,r,o,i,u={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(i){return function(a){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;u;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return u.label++,{value:i[1],done:!1};case 5:u.label++,r=i[1],i=[0];continue;case 7:i=u.ops.pop(),u.trys.pop();continue;default:if(!(o=u.trys,(o=o.length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){u=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){u.label=i[1];break}if(6===i[0]&&u.label<o[1]){u.label=o[1],o=i;break}if(o&&u.label<o[2]){u.label=o[2],u.ops.push(i);break}o[2]&&u.ops.pop(),u.trys.pop();continue}i=e.call(t,u)}catch(t){i=[6,t],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,a])}}}function p(t,e,n,r){void 0===r&&(r=n),t[r]=e[n]}function y(t,e){for(var n in t)"default"===n||e.hasOwnProperty(n)||(e[n]=t[n])}function d(t){var e="function"==typeof Symbol&&Symbol.iterator,n=e&&t[e],r=0;if(n)return n.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function _(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,o,i=n.call(t),u=[];try{for(;(void 0===e||e-- >0)&&!(r=i.next()).done;)u.push(r.value)}catch(t){o={error:t}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return u}function h(){for(var t=[],e=0;e<arguments.length;e++)t=t.concat(_(arguments[e]));return t}function v(){for(var t=0,e=0,n=arguments.length;e<n;e++)t+=arguments[e].length;var r=Array(t),o=0;for(e=0;e<n;e++)for(var i=arguments[e],u=0,a=i.length;u<a;u++,o++)r[o]=i[u];return r}function b(t){return this instanceof b?(this.v=t,this):new b(t)}function w(t,e,n){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var r,o=n.apply(t,e||[]),i=[];return r={},u("next"),u("throw"),u("return"),r[Symbol.asyncIterator]=function(){return this},r;function u(t){o[t]&&(r[t]=function(e){return new Promise((function(n,r){i.push([t,e,n,r])>1||a(t,e)}))})}function a(t,e){try{(n=o[t](e)).value instanceof b?Promise.resolve(n.value.v).then(c,f):l(i[0][2],n)}catch(t){l(i[0][3],t)}var n}function c(t){a("next",t)}function f(t){a("throw",t)}function l(t,e){t(e),i.shift(),i.length&&a(i[0][0],i[0][1])}}function g(t){var e,n;return e={},r("next"),r("throw",(function(t){throw t})),r("return"),e[Symbol.iterator]=function(){return this},e;function r(r,o){e[r]=t[r]?function(e){return(n=!n)?{value:b(t[r](e)),done:"return"===r}:o?o(e):e}:o}}function m(t){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var e,n=t[Symbol.asyncIterator];return n?n.call(t):(t=d(t),e={},r("next"),r("throw"),r("return"),e[Symbol.asyncIterator]=function(){return this},e);function r(n){e[n]=t[n]&&function(e){return new Promise((function(r,o){(function(t,e,n,r){Promise.resolve(r).then((function(e){t({value:e,done:n})}),e)})(r,o,(e=t[n](e)).done,e.value)}))}}}function S(t,e){return Object.defineProperty?Object.defineProperty(t,"raw",{value:e}):t.raw=e,t}function O(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)Object.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e.default=t,e}function j(t){return t&&t.__esModule?t:{default:t}}function P(t,e){if(!e.has(t))throw new TypeError("attempted to get private field on non-instance");return e.get(t)}function x(t,e,n){if(!e.has(t))throw new TypeError("attempted to set private field on non-instance");return e.set(t,n),n}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.safeJsonParse=function(t){if("string"!=typeof t)throw new Error("Cannot safe json parse value of type "+typeof t);try{return JSON.parse(t)}catch(e){return t}},e.safeJsonStringify=function(t){return"string"==typeof t?t:JSON.stringify(t,(t,e)=>void 0===e?null:e)}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.KeyValueStorage=void 0;const r=n(0),o=n(1),i=r.__importDefault(n(3)),u=n(5);class a{constructor(){this.localStorage=i.default}getKeys(){return r.__awaiter(this,void 0,void 0,(function*(){return Object.keys(this.localStorage)}))}getEntries(){return r.__awaiter(this,void 0,void 0,(function*(){return Object.entries(this.localStorage).map(u.parseEntry)}))}getItem(t){return r.__awaiter(this,void 0,void 0,(function*(){const e=this.localStorage.getItem(t);if(null!==e)return o.safeJsonParse(e)}))}setItem(t,e){return r.__awaiter(this,void 0,void 0,(function*(){this.localStorage.setItem(t,o.safeJsonStringify(e))}))}removeItem(t){return r.__awaiter(this,void 0,void 0,(function*(){this.localStorage.removeItem(t)}))}}e.KeyValueStorage=a,e.default=a},function(t,e,n){"use strict";(function(e){!function(){let n;function r(){}n=r,n.prototype.getItem=function(t){return this.hasOwnProperty(t)?String(this[t]):null},n.prototype.setItem=function(t,e){this[t]=String(e)},n.prototype.removeItem=function(t){delete this[t]},n.prototype.clear=function(){const t=this;Object.keys(t).forEach((function(e){t[e]=void 0,delete t[e]}))},n.prototype.key=function(t){return t=t||0,Object.keys(this)[t]},n.prototype.__defineGetter__("length",(function(){return Object.keys(this).length})),void 0!==e&&e.localStorage?t.exports=e.localStorage:"undefined"!=typeof window&&window.localStorage?t.exports=window.localStorage:t.exports=new r}()}).call(this,n(4))},function(t,e){var n;n=function(){return this}();try{n=n||new Function("return this")()}catch(t){"object"==typeof window&&(n=window)}t.exports=n},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});const r=n(0);r.__exportStar(n(6),e),r.__exportStar(n(7),e)},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.IKeyValueStorage=void 0;e.IKeyValueStorage=class{}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.parseEntry=void 0;const r=n(1);e.parseEntry=function(t){var e;return[t[0],r.safeJsonParse(null!==(e=t[1])&&void 0!==e?e:"")]}}])})); |
{ | ||
"name": "@walletconnect/keyvaluestorage", | ||
"description": "Isomorphic Key-Value Storage", | ||
"version": "1.0.1-rc.1-1c715f7f", | ||
"version": "1.0.2", | ||
"author": "WalletConnect, Inc. <walletconnect.com>", | ||
@@ -42,4 +42,4 @@ "license": "MIT", | ||
"dependencies": { | ||
"localStorage": "^1.0.4", | ||
"safe-json-utils": "^1.1.1" | ||
"safe-json-utils": "^1.1.1", | ||
"tslib": "1.14.1" | ||
}, | ||
@@ -62,3 +62,3 @@ "peerDependencies": { | ||
"@types/node": "^14.14.7", | ||
"@walletconnect/time": "^1.0.1", | ||
"@walletconnect/time": "^1.0.2", | ||
"chai": "^4.3.6", | ||
@@ -73,3 +73,2 @@ "classic-level": "^1.2.0", | ||
"ts-node": "^10.9.1", | ||
"tslib": "^1.10.0", | ||
"typescript": "^3.7.5", | ||
@@ -76,0 +75,0 @@ "webpack": "^4.41.6", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
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
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
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
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
290814
16
86
745
0
1
+ Addedtslib@1.14.1
+ Addedtslib@1.14.1(transitive)
- RemovedlocalStorage@^1.0.4
- RemovedlocalStorage@1.0.4(transitive)