Update 'index.js'
This commit is contained in:
parent
570795b832
commit
f696c8579a
14
index.js
14
index.js
@ -7,11 +7,13 @@ function loadDB(databaseFile) {
|
|||||||
fs.writeFileSync(databaseFile, JSON.stringify({}));
|
fs.writeFileSync(databaseFile, JSON.stringify({}));
|
||||||
_db = {};
|
_db = {};
|
||||||
}
|
}
|
||||||
return new Proxy(_db, {
|
return class {
|
||||||
set: function (target, key, value) {
|
constructor() {
|
||||||
target[key] = value;
|
this.v = _db
|
||||||
fs.writeFileSync(databaseFile, JSON.stringify(target));
|
this.update = function() {
|
||||||
},
|
fs.writeFileSync(databaseFile, JSON.stringify(this.v));
|
||||||
});
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
exports.loadDB = loadDB;
|
exports.loadDB = loadDB;
|
||||||
|
Loading…
Reference in New Issue
Block a user