Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
jajbshjahavahh
GitHub Repository: jajbshjahavahh/Gojo-Satoru
Path: blob/master/lib/lowdb/Low.js
2591 views
1
//═══════════════════════════════════════════════════════//
2
//If you want to recode, reupload
3
//or copy the codes/script,
4
//pls give credit
5
//no credit? i will take action immediately
6
//© 2022 Xeon Bot Inc. Cheems Bot MD
7
//Thank you to Lord Buddha, Family and Myself
8
//════════════════════════════//
9
const { MissingAdapterError } = require('./MissingAdapterError.js');
10
class Low {
11
constructor(adapter) {
12
this.data = null;
13
if (adapter) {
14
this.adapter = adapter;
15
}
16
else {
17
throw new MissingAdapterError();
18
}
19
}
20
async read() {
21
this.data = await this.adapter.read();
22
}
23
async write() {
24
if (this.data) {
25
await this.adapter.write(this.data);
26
}
27
}
28
}
29
module.exports = { Low };
30
31