class s{constructor(s,e=null,i=(s=>s)){this._valueProvider=s,this._size=e,this._keySerializer=i,this._map=new Map,this._keys=[]}get(s){const e=this._keySerializer(s);if(this._map.has(e))return this._map.get(e);const i=this._valueProvider(s);if(this._map.set(e,i),this._keys.push(e),null!=this._size&&this._keys.length>this._size){const s=this._keys.shift();this._map.delete(s)}return i}has(s){return this._map.has(this._keySerializer(s))}evict(s){const e=this._keySerializer(s);this._map.has(e)&&(this._keys.splice(this._keys.indexOf(e),1),this._map.delete(e))}clear(){this._map.clear(),this._keys=[]}}export{s as MemoryCache};
//# sourceMappingURL=memory-cache.js.map
