text: 'use strict';var _typeof='function'==typeof Symbol&&'symbol'==typeof Symbol.iterator?function(a){return typeof a}:function(a){return a&&'function'==typeof Symbol&&a.constructor===Symbol&&a!==Symbol.prototype?'symbol':typeof a};Object.defineProperty(exports,'__esModule',{value:!0});function _toConsumableArray(a){if(Array.isArray(a)){for(var b=0,c=Array(a.length);b<a.length;b++)c[b]=a[b];return c}return Array.from(a)}var localStorageAvailable=function(){var a='object'===_typeof(window.localStorage)&&'function'==typeof window.localStorage.setItem;if(!a)return!1;var b='safeLocalStorageTest';try{return window.localStorage.setItem(b,'succeeds'),window.localStorage.removeItem(b),!0}catch(a){return!1}},noop=function(){},useStorageWhenAvailable=function(a,b){var c=2<arguments.length&&arguments[2]!==void 0?arguments[2]:noop;if(localStorageAvailable()){var d;return(d=window.localStorage)[a].apply(d,_toConsumableArray(b))}c()},safeLocalStorage={get:function get(a,b){return useStorageWhenAvailable('getItem',[a],b)},set:function set(a,b,c){useStorageWhenAvailable('setItem',[a,b],c)},remove:function remove(a,b){useStorageWhenAvailable('removeItem',[a],b)},removeAll:function removeAll(a){useStorageWhenAvailable('clear',[],a)}};exports.default=safeLocalStorage;
  