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';