formdata-node
Advanced tools
Comparing version 0.3.0 to 0.3.1
@@ -253,3 +253,3 @@ "use strict"; | ||
// Try to get a filename for buffer and Readable values | ||
// Try to get a filename for Buffer and Readable values | ||
if ((0, _isBuffer2.default)(value) && filename) { | ||
@@ -262,2 +262,5 @@ filename = (0, _path.basename)(filename); | ||
filename = (0, _path.basename)(value.path || filename); | ||
} else { | ||
// The regular values shouldn't have "filename" property | ||
filename = void 0; | ||
} | ||
@@ -395,2 +398,7 @@ | ||
/** | ||
* An alias of FormData#stream.pipe | ||
*/ | ||
/** | ||
* Executes a given callback for each field of the FormData instance | ||
@@ -429,15 +437,13 @@ * | ||
*values() { | ||
*entries() { | ||
for (const name of this.keys()) { | ||
const value = this.getAll(name); | ||
const values = this.getAll(name); | ||
yield value.length === 1 ? value[0] : value; | ||
yield [name, values.length === 1 ? values[0] : values]; | ||
} | ||
} | ||
*entries() { | ||
for (const name of this.keys()) { | ||
const value = this.getAll(name); | ||
yield [name, value.length === 1 ? value[0] : value]; | ||
*values() { | ||
for (const [, values] of this.entries()) { | ||
yield values; | ||
} | ||
@@ -530,8 +536,2 @@ } | ||
this.on = (name, fn) => { | ||
this.__stream.on(name, fn); | ||
return this; | ||
}; | ||
this.forEach = (fn, ctx = null) => { | ||
@@ -538,0 +538,0 @@ for (const [name, value] of this) { |
{ | ||
"name": "formdata-node", | ||
"version": "0.3.0", | ||
"version": "0.3.1", | ||
"description": "FormData implementation for Node.js. Built over Readable stream and async generators.", | ||
@@ -21,4 +21,4 @@ "repository": "octet-stream/form-data", | ||
"test": "node_modules/.bin/ava", | ||
"coverage": "yarn make:ci && node_modules/.bin/nyc yarn test && yarn cleanup && yarn make", | ||
"report": "yarn make:ci && node_modules/.bin/nyc yarn test && node_modules/.bin/nyc report --reporter=html yarn test && yarn cleanup && yarn make", | ||
"coverage": "yarn cleanup && yarn make:ci && node_modules/.bin/nyc yarn test && yarn cleanup && yarn make", | ||
"report": "yarn cleanup && yarn make:ci && node_modules/.bin/nyc yarn test && node_modules/.bin/nyc report --reporter=html yarn test && yarn cleanup && yarn make", | ||
"ci": "yarn make:ci && node_modules/.bin/nyc yarn test && node_modules/.bin/nyc report --reporter=lcov yarn test && node_modules/.bin/codecov && yarn cleanup && yarn make", | ||
@@ -36,4 +36,4 @@ "precommit": "yarn lint", | ||
"devDependencies": { | ||
"@octetstream/eslint-config": "2.0.2", | ||
"ava": "0.22.0", | ||
"@octetstream/eslint-config": "2.1.0", | ||
"ava": "0.23.0", | ||
"babel-cli": "6.26.0", | ||
@@ -47,4 +47,4 @@ "babel-core": "6.26.0", | ||
"babel-plugin-transform-runtime": "6.23.0", | ||
"codecov": "2.3.1", | ||
"eslint": "4.9.0", | ||
"codecov": "3.0.0", | ||
"eslint": "4.10.0", | ||
"eslint-plugin-ava": "4.2.2", | ||
@@ -57,5 +57,5 @@ "husky": "0.14.3", | ||
"rimraf": "2.6.2", | ||
"sinon": "4.0.1", | ||
"sinon": "4.0.2", | ||
"supertest": "3.0.0", | ||
"then-busboy": "2.1.1" | ||
"then-busboy": "2.1.3" | ||
}, | ||
@@ -66,4 +66,4 @@ "dependencies": { | ||
"mime-types": "2.1.17", | ||
"nanoid": "0.2.2" | ||
"nanoid": "1.0.0" | ||
} | ||
} |
28498
580
+ Addednanoid@1.0.0(transitive)
- Removednanoid@0.2.2(transitive)
Updatednanoid@1.0.0