node-persist
Advanced tools
Comparing version 3.0.2 to 3.0.3
{ | ||
"name": "node-persist", | ||
"version": "3.0.2", | ||
"version": "3.0.3", | ||
"description": "Super-easy (and fast) persistent data structures in Node.js, modeled after HTML5 localStorage", | ||
@@ -5,0 +5,0 @@ "main": "./src/node-persist.js", |
@@ -54,3 +54,3 @@ /* | ||
const isExpired = function (datum) { | ||
return datum.ttl && datum.ttl < (new Date()).getTime(); | ||
return datum && datum.ttl && datum.ttl < (new Date()).getTime(); | ||
}; | ||
@@ -316,3 +316,3 @@ | ||
if (!options.raw && !isValidStorageFileContent(input)) { | ||
return this.options.forgiveParseErrors ? resolve() : reject(new Error(`[node-persist][readFile] ${file} does not look like a valid storage file!`)); | ||
return this.options.forgiveParseErrors ? resolve(options.raw ? '{}' : {}) : reject(new Error(`[node-persist][readFile] ${file} does not look like a valid storage file!`)); | ||
} | ||
@@ -319,0 +319,0 @@ resolve(input); |
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
31934