/* COPYRIGHT Esri - https://js.arcgis.com/5.0.18/LICENSE.txt */
const t=new WeakMap;class s{constructor(s,e){switch(this._miss=0,this._hit=0,this.initialized=!0,e){case"layer":this._data=new Map;break;case"view":{const e=t.get(s);if(e){this._data=e;break}const i=new Map;this._data=i,t.set(s,i)}}}init(){return Promise.resolve()}async get(t,s){if(this._data.has(t))return this._hit++,this._data.get(t)??void 0;this._miss++}destroy(){}put(t,s){return this._data.set(t,s),Promise.resolve()}remove(t){return this._data.delete(t),Promise.resolve()}getHitRate(){return this._hit/(this._hit+this._miss)}}export{s as IDBMockCache};
