UNPKG

@sofaws/dapp-core

Version:

A library to hold the main logic for a dapp on the Elrond Network

3 lines (2 loc) 712 B
import{e as p,g as y,m as r}from"./chunk-HBP5N4FR.js";var m={};y(m,{clear:()=>a,getItem:()=>n,removeItem:()=>i,setItem:()=>o,storage:()=>S});var o,n,i,a,S,g=p(()=>{r();o=({key:t,data:s,expires:e})=>{sessionStorage.setItem(String(t),JSON.stringify({expires:e,data:s}))},n=t=>{let s=sessionStorage.getItem(String(t));if(!s)return null;let e=JSON.parse(s);return!e||!e.hasOwnProperty("expires")||!e.hasOwnProperty("data")?null:Date.now()>=e.expires?(sessionStorage.removeItem(String(t)),null):e.data},i=t=>sessionStorage.removeItem(String(t)),a=()=>sessionStorage.clear(),S={setItem:o,getItem:n,removeItem:i,clear:a}});export{o as a,n as b,i as c,a as d,S as e,m as f,g}; //# sourceMappingURL=chunk-PXHBOM4A.js.map