From 11161443e1de0015dc0a0469d93c59120daa4c91 Mon Sep 17 00:00:00 2001 From: JP-Garcia <104278439+JP-Garcia@users.noreply.github.com> Date: Mon, 30 Sep 2024 19:54:33 -0500 Subject: [PATCH] fixed error with lowdb --- src/util.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/util.js b/src/util.js index 308952d5..6c5cdef7 100644 --- a/src/util.js +++ b/src/util.js @@ -11,8 +11,9 @@ export const dataDir = s => path.resolve(__dirname, '..', 'data', s); export const resolve = (...a) => a.length && a[0] == '0' ? null : path.resolve(...a); // json database -import { JSONFilePreset } from 'lowdb/node'; -export const jsonDb = (file, defaultData) => JSONFilePreset(dataDir(file), defaultData); +import { LowSync } from "lowdb"; +import { JSONFileSync } from "lowdb/node"; +export const jsonDb = (file, defaultData) => new LowSync(new JSONFileSync(dataDir(file)), defaultData); export const delay = ms => new Promise(resolve => setTimeout(resolve, ms)); // date and time as UTC (no timezone offset) in nicely readable and sortable format, e.g., 2022-10-06 12:05:27.313