Comparing version 1.1.0 to 1.2.0
12
index.js
@@ -78,3 +78,3 @@ /** | ||
return function(done) { | ||
var form = new forms.IncomingForm(opts) | ||
var form = new forms.IncomingForm(opts); | ||
var fields = {}; | ||
@@ -90,3 +90,11 @@ var files = {}; | ||
.on('field', function(field, value) { | ||
fields[field] = value; | ||
if (fields[field]) { | ||
if (Array.isArray(fields[field])) { | ||
fields[field].push(value); | ||
} else { | ||
fields[field] = [fields[field], value]; | ||
} | ||
} else { | ||
fields[field] = value; | ||
} | ||
}) | ||
@@ -93,0 +101,0 @@ .on('file', function(field, file) { |
{ | ||
"name": "koa-body", | ||
"version": "1.1.0", | ||
"version": "1.2.0", | ||
"description": "A koa body parser middleware. Support multipart, urlencoded and json request bodies.", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
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
10225
103