"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});class i{constructor(e=50){this.store=new Map,this.maxSize=e,this.isExpired=!1,this.expiredTimer=null}changeMaxSize(e){this.maxSize=e}expireCheck(){this.isExpired&&(clearTimeout(this.expiredTimer),this.expiredTimer=setTimeout(()=>{this.isExpired=!1}))}has(e){return this.expireCheck(),this.store.has(e)}get(e){if(this.expireCheck(),!this.has(e))return null;const t=this.store.get(e);return this.store.delete(e),this.store.set(e,t),t}set(e,t){if(this.expireCheck(),!this.isExpired){if(this.has(e))this.store.delete(e);else if(this.store.size>=this.maxSize){const s=this.store.keys().next().value;s&&this.store.delete(s)}Array.isArray(t)&&(t=new Map(t)),this.store.set(e,t)}}del(e){this.isExpired=!0,this.store.delete(e)}clear(){this.store.clear()}}exports.LruCacher=i;exports.default=i;
