Skip to content
This repository was archived by the owner on Mar 24, 2024. It is now read-only.

Commit 17e3a05

Browse files
committed
Fix a bug in saveData
1 parent 5dd2d37 commit 17e3a05

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

index.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -509,7 +509,7 @@ class jsonverse {
509509
...newData,
510510
};
511511

512-
existingData.unshift(newDataWithId);
512+
existingData.push(newDataWithId); // Append the new data to the existing array
513513

514514
await this.writeDataByFileName(dataName, existingData).then(() => {
515515
this.logSuccess(`New Data added to DB: ${dataName}`);
@@ -602,4 +602,4 @@ class jsonverse {
602602
}
603603
}
604604

605-
module.exports = jsonverse;
605+
module.exports = jsonverse;

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "jsonverse",
3-
"version": "1.2.5",
3+
"version": "1.2.6",
44
"description": "jsonVerse is a lightweight JSON-based database package for Node.js. It provides a simple interface to store, retrieve, and manage data using JSON files.",
55
"main": "index.js",
66
"scripts": {

0 commit comments

Comments
 (0)