update dependencies via ncu -u, lowdb: pass defaultData
dotenv ^16.0.3 → ^16.3.1 enquirer ^2.3.6 → ^2.4.1 lowdb ^5.1.0 → ^6.0.1 playwright-firefox ^1.31.0 → ^1.37.1 puppeteer-extra-plugin-stealth ^2.11.1 → ^2.11.2 https://github.com/typicode/lowdb/releases/tag/v6.0.0 > Require defaultData parameter for Low and LowSync constructors to improve TypeScript experience
This commit is contained in:
parent
3d1168f653
commit
6a7cca31a4
7 changed files with 143 additions and 110 deletions
4
util.js
4
util.js
|
|
@ -13,8 +13,8 @@ export const resolve = (...a) => a.length && a[0] == '0' ? null : path.resolve(.
|
|||
// json database
|
||||
import { Low } from 'lowdb';
|
||||
import { JSONFile } from 'lowdb/node';
|
||||
export const jsonDb = async file => {
|
||||
const db = new Low(new JSONFile(dataDir(file)));
|
||||
export const jsonDb = async (file, defaultData) => {
|
||||
const db = new Low(new JSONFile(dataDir(file)), defaultData);
|
||||
await db.read();
|
||||
return db;
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue