node-persist
Advanced tools
Comparing version 2.0.4 to 2.0.5
{ | ||
"name": "node-persist", | ||
"version": "2.0.4", | ||
"version": "2.0.5", | ||
"description": "Super-easy (and fast) persistent data structures in Node.js, modeled after HTML5 localStorage", | ||
@@ -5,0 +5,0 @@ "main": "./src/node-persist.js", |
@@ -486,9 +486,10 @@ /* | ||
result = {key: key, removed: !err, existed: exists}; | ||
if (err) { | ||
if (err && err.code != 'ENOENT') { /* Only throw the error if the error is something else */ | ||
deferred.reject(err); | ||
return callback(err); | ||
} | ||
err && this.log('Failed to remove file:' + file + ' because it doesn\'t exist anymore.'); | ||
deferred.resolve(result); | ||
callback(null, result); | ||
}); | ||
}.bind(this)); | ||
} else { | ||
@@ -508,3 +509,10 @@ result = {key: key, removed: false, existed: exists}; | ||
if (fs.existsSync(file)) { | ||
fs.unlinkSync(file); | ||
try { | ||
fs.unlinkSync(file); | ||
} catch (err) { | ||
if (err.code != 'ENOENT') { /* Only throw the error if the error is something else */ | ||
throw err; | ||
} | ||
this.log('Failed to remove file:' + file + ' because it doesn\'t exist anymore.'); | ||
} | ||
return {key: key, removed: true, existed: true}; | ||
@@ -511,0 +519,0 @@ } |
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
49664
1008