UNPKG

sandeep-utileo

Version:

JS library with most common utils.

2 lines (1 loc) 487 B
var t={},e=function(e){return function(t){try{return JSON.parse(t)}catch(e){return t}}(t[e]||window.localStorage.getItem(e))},o=function(e,o){var n="";"object"==typeof o&&(n=JSON.stringify(o));try{window.localStorage.setItem(e,n)}catch(o){t[e]=n}},n=function(e){return e in t||null!==window.localStorage.getItem(e)},r=function(e){window.localStorage.removeItem(e),delete t[e]},c=function(){t={},window.localStorage.clear()};export{e as get,n as has,r as remove,c as removeAll,o as set};