From c8410b0c6fe4e6d568d4d7539096e2535c49a83c Mon Sep 17 00:00:00 2001 From: Killer Boss Original <73131550+killerbossoriginal@users.noreply.github.com> Date: Thu, 23 Feb 2023 12:17:13 +0100 Subject: [PATCH] 2023.02.23.4 --- package.json | 2 +- src/index.ts | 6 ++---- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/package.json b/package.json index 9b71b5b..7e0630a 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "mit.db", - "version": "2023.02.23.3", + "version": "2023.02.23.4", "description": "An easy and quick database", "main": "build/index.js", "types": "build/index.d.ts", diff --git a/src/index.ts b/src/index.ts index cbc0ae6..037d291 100644 --- a/src/index.ts +++ b/src/index.ts @@ -99,11 +99,11 @@ class MitDB { * * @param callbackfn */ - forEach(callback: (value: any, key: any, map: Map) => void) { + forEach(callback: (value: any, key: any) => void) { const file = fs.readFileSync(this.db); const data: any[] = JSON.parse(file.toString()); - data.forEach((pair: any) => callback(pair.value, pair.key, map)); + data.forEach((pair: any) => callback(pair.value, pair.key)); } /** @@ -122,8 +122,6 @@ class MitDB { await writeDB(this.db, JSON.stringify(data)); return true; - } else if (!map) { - return false; } } catch {} return 'error';