fortune-fs
Advanced tools
Comparing version 1.2.0 to 1.2.1
11
index.js
@@ -119,3 +119,12 @@ 'use strict' | ||
record = msgpack.decode(buffer) | ||
if(buffer.length === 0) { | ||
return reject(new Error(`Decode record failed. File is empty: ${filePath}`)) | ||
} | ||
else { | ||
try { | ||
record = msgpack.decode(buffer) | ||
} catch (e) { | ||
return reject(new Error(`Decode record failed. File is corrupt: ${filePath}`, { cause: e })) | ||
} | ||
} | ||
@@ -122,0 +131,0 @@ if (!(type in self.db)) self.db[type] = {} |
{ | ||
"name": "fortune-fs", | ||
"description": "File system adapter for Fortune.", | ||
"version": "1.2.0", | ||
"version": "1.2.1", | ||
"license": "MIT", | ||
"repository": { | ||
"type": "git", | ||
"url": "git@github.com:fortunejs/fortune-fs.git" | ||
"url": "git+ssh://git@github.com/fortunejs/fortune-fs.git" | ||
}, | ||
@@ -14,3 +14,3 @@ "scripts": { | ||
"tag": "git tag `npm v fortune-fs version` && git push origin --tags", | ||
"test": "npm run lint && node test.js" | ||
"test": "npm run lint && node test/test.js" | ||
}, | ||
@@ -28,2 +28,5 @@ "dependencies": { | ||
}, | ||
"files": [ | ||
"index.js" | ||
], | ||
"keywords": [ | ||
@@ -30,0 +33,0 @@ "fs", |
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
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
0
10762
4
207