Comparing version 0.11.3 to 0.11.4
13
index.js
@@ -55,2 +55,4 @@ 'use strict'; | ||
db.object = obj; | ||
db._checksum = JSON.stringify(db.object); | ||
return db; | ||
@@ -61,2 +63,4 @@ }); | ||
db.object = res; | ||
db._checksum = JSON.stringify(db.object); | ||
return db; | ||
@@ -89,5 +93,2 @@ }; | ||
// Init db.object checksum | ||
var checksum = JSON.stringify(db.object); | ||
// Return a promise or nothing in sync mode or if the database hasn't changed | ||
@@ -98,4 +99,4 @@ function _save() { | ||
if (str !== checksum) { | ||
checksum = str; | ||
if (str !== db._checksum) { | ||
db._checksum = str; | ||
return db.write(db.source, db.object); | ||
@@ -122,3 +123,3 @@ } | ||
if (db.read) { | ||
return db.read(source); | ||
return db.read(); | ||
} else { | ||
@@ -125,0 +126,0 @@ return db; |
{ | ||
"name": "lowdb", | ||
"version": "0.11.3", | ||
"version": "0.11.4", | ||
"description": "JSON database for Node and the browser powered by lodash", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
17114