This commit is contained in:
Killer Boss Original 2023-04-12 18:29:31 +02:00 committed by GitHub
parent 41d589ccbc
commit 363492aef5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -5,6 +5,8 @@ const writeDB = promisify(fs.writeFile);
class MitDB {
readonly db;
fn: string;
options?: any;
/**
* @constructor
@ -37,7 +39,7 @@ class MitDB {
const data: any[] = JSON.parse(file.toString());
const i = data.findIndex((pair: any) => pair.key == key);
!data[i] ? data.push({ key, value }) : data[i] = { key, value };
await writeDB(this.db, JSON.stringify(data));