From e269f2c9d3668274cf5a270e1ee2e3189dc55b77 Mon Sep 17 00:00:00 2001 From: Killer Boss Original <73131550+killerbossoriginal@users.noreply.github.com> Date: Thu, 23 Feb 2023 11:58:44 +0100 Subject: [PATCH] ttf --- src/index.ts | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/index.ts b/src/index.ts index d8f9046..8045b5a 100644 --- a/src/index.ts +++ b/src/index.ts @@ -3,7 +3,7 @@ import * as fs from 'fs'; const writeDB = promisify(fs.writeFile); -let map: any, db: any, filename: string, dirname: string; +let map: any, filename: string; class MitDB { /** @@ -14,17 +14,16 @@ class MitDB { * @param options.dirname where to put the database? */ constructor(fn?: string, options?: { dirname: string }) { - if (!dirname || dirname != 'data') dirname = 'data'; - map = new Map(); if (fn) filename = fn; - if (options && options.dirname) dirname = options.dirname; + if (options && options.dirname) const dirname = options.dirname; + else const dirname = 'data'; if (!fs.existsSync(dirname)) fs.mkdirSync(dirname); - db = `./${dirname}/${filename}` + const db = `./${dirname}/${filename}` } /**