added doga

This commit is contained in:
szabomarton
2025-02-25 09:55:29 +01:00
parent 5174ab4cc4
commit 13254e5623
1149 changed files with 80161 additions and 0 deletions

30
25_02_24/node_modules/json-server/lib/observer.js generated vendored Normal file
View File

@@ -0,0 +1,30 @@
// Lowdb adapter to observe read/write events
export class Observer {
#adapter;
onReadStart = function () {
return;
};
onReadEnd = function () {
return;
};
onWriteStart = function () {
return;
};
onWriteEnd = function () {
return;
};
constructor(adapter) {
this.#adapter = adapter;
}
async read() {
this.onReadStart();
const data = await this.#adapter.read();
this.onReadEnd(data);
return data;
}
async write(arg) {
this.onWriteStart();
await this.#adapter.write(arg);
this.onWriteEnd();
}
}