/**
 * Minified by jsDelivr using Terser v5.39.0.
 * Original file: /npm/test-data-store@0.1.1/index.js
 *
 * Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files
 */
function fakeAsync(t){return new Promise((e=>{setTimeout((()=>{e(t())}),50)}))}module.exports=class{constructor(){this.data=[],this.id_stack=0}getAll(){return fakeAsync((()=>this.data))}get(t){return fakeAsync((()=>{const e=this.data.findIndex((e=>e.id==t));return e>=0?this.data[e]:Promise.reject({status:500,id:t})}))}add(t){return fakeAsync((()=>{t.id=this.id_stack++;const e=this.data.push(t)-1;return this.data[e]}))}update(t,e){return fakeAsync((()=>{const s=this.data.findIndex((e=>e.id==t));return s>-1?(this.data[s]=e,this.data[s]):Promise.reject({status:500,id:_d,data:e})}))}delete(t){return fakeAsync((()=>{const e=this.data.findIndex((e=>e.id==t));if(e>-1){return this.data.splice(e,1)[0]}return Promise.reject({status:500,id:t})}))}length(){return fakeAsync((()=>this.data.length))}};
//# sourceMappingURL=/sm/fefcc0c21afb06148cb72e7e683a33669b3efa43b1bf997f38dda07c3c761b11.map