Comparing version 2.0.0-beta.1 to 2.0.0-rc.1
@@ -6,2 +6,8 @@ # Change log | ||
## 2.0.0-rc.1 - 2020-02-26 | ||
- Breaking: drop support for Node.js < 10.13.x | ||
- Internal: achive 100% code coverage | ||
- Internal: test on macOS & Windows | ||
## 2.0.0-beta.1 - 2019-11-23 | ||
@@ -8,0 +14,0 @@ |
@@ -7,2 +7,3 @@ function createFileAppender (strategy, req, fields) { | ||
case 'OBJECT': req.files = Object.create(null); break | ||
// istanbul ignore next | ||
default: throw new Error(`Unknown file strategy: ${strategy}`) | ||
@@ -19,3 +20,2 @@ } | ||
switch (strategy) { | ||
case 'NONE': break | ||
case 'VALUE': req.file = file; break | ||
@@ -22,0 +22,0 @@ case 'ARRAY': req.files.push(file); break |
@@ -6,2 +6,3 @@ const path = require('path') | ||
const FileType = require('stream-file-type') | ||
const hasOwnProperty = require('has-own-property') | ||
@@ -22,8 +23,10 @@ const pump = pify(require('pump')) | ||
busboy.on('field', (fieldname, value, fieldnameTruncated, valueTruncated) => { | ||
// istanbul ignore next: Currently not implemented (https://github.com/mscdex/busboy/issues/6) | ||
if (fieldnameTruncated) return reject(new MulterError('LIMIT_FIELD_KEY')) | ||
if (valueTruncated) return reject(new MulterError('LIMIT_FIELD_VALUE', fieldname)) | ||
// Work around bug in Busboy (https://github.com/mscdex/busboy/issues/6) | ||
if (limits && limits.hasOwnProperty('fieldNameSize')) { | ||
if (fieldname.length > limits.fieldNameSize) return reject(new MulterError('LIMIT_FIELD_KEY')) | ||
if (limits && hasOwnProperty(limits, 'fieldNameSize') && fieldname.length > limits.fieldNameSize) { | ||
return reject(new MulterError('LIMIT_FIELD_KEY')) | ||
} | ||
@@ -52,4 +55,4 @@ | ||
// Work around bug in Busboy (https://github.com/mscdex/busboy/issues/6) | ||
if (limits && limits.hasOwnProperty('fieldNameSize')) { | ||
if (fieldname.length > limits.fieldNameSize) return reject(new MulterError('LIMIT_FIELD_KEY')) | ||
if (limits && hasOwnProperty(limits, 'fieldNameSize') && fieldname.length > limits.fieldNameSize) { | ||
return reject(new MulterError('LIMIT_FIELD_KEY')) | ||
} | ||
@@ -123,3 +126,3 @@ | ||
// Wait for request to close, finish, or error | ||
await onFinished(req).catch(() => {}) | ||
await onFinished(req).catch(/* istanbul ignore next: Already handled by req.on('error', _) */ () => {}) | ||
@@ -126,0 +129,0 @@ throw err |
{ | ||
"name": "multer", | ||
"description": "Middleware for handling `multipart/form-data`.", | ||
"version": "2.0.0-beta.1", | ||
"version": "2.0.0-rc.1", | ||
"contributors": [ | ||
@@ -25,4 +25,5 @@ "Hage Yaapa <captain@hacksparrow.com> (http://www.hacksparrow.com)", | ||
"fs-temp": "^1.1.1", | ||
"has-own-property": "^1.0.0", | ||
"on-finished": "^2.3.0", | ||
"pify": "^4.0.1", | ||
"pify": "^5.0.0", | ||
"pump": "^3.0.0", | ||
@@ -37,10 +38,11 @@ "stream-file-type": "^0.4.0", | ||
"get-stream": "^5.1.0", | ||
"hasha": "^5.1.0", | ||
"mocha": "^6.1.4", | ||
"hasha": "^5.2.0", | ||
"mocha": "^7.1.0", | ||
"nyc": "^15.0.0", | ||
"recursive-nullify": "^1.0.0", | ||
"standard": "^12.0.1", | ||
"standard": "^14.3.1", | ||
"testdata-w3c-json-form": "^1.0.0" | ||
}, | ||
"engines": { | ||
"node": ">=8.3" | ||
"node": ">=10.13" | ||
}, | ||
@@ -53,4 +55,4 @@ "files": [ | ||
"scripts": { | ||
"test": "standard && mocha" | ||
"test": "standard && nyc --check-coverage --statements 100 mocha" | ||
} | ||
} |
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
18668
234
9
10
+ Addedhas-own-property@^1.0.0
+ Addedhas-own-property@1.0.0(transitive)
+ Addedpify@5.0.0(transitive)
- Removedpify@4.0.1(transitive)
Updatedpify@^5.0.0