then-busboy
Advanced tools
Comparing version 2.0.0-beta.9 to 2.0.0-beta.10
@@ -7,6 +7,4 @@ "use strict"; | ||
var _cloneableReadable = require("cloneable-readable"); | ||
var _stream = require("stream"); | ||
var _cloneableReadable2 = _interopRequireDefault(_cloneableReadable); | ||
var _File = require("../File"); | ||
@@ -26,13 +24,17 @@ | ||
// We need to clone file Readable stream before creating a File instance. | ||
const contents = (0, _cloneableReadable2.default)(stream); | ||
const contents = new _stream.Readable({ | ||
read() {/* noop */} | ||
}); | ||
const file = new _File2.default({ filename, contents, enc, mime }); | ||
const onData = ch => contents.push(ch); | ||
// Busboy will not fire "finish" event because of we're don't read data from | ||
// a file stream. So, here we just fire "end" manually to prevent | ||
// an inifinite Promise pending. | ||
stream.emit("end"); | ||
const onEnd = () => { | ||
contents.push(null); | ||
cb(null, [path, file]); | ||
const file = new _File2.default({ filename, contents, enc, mime }); | ||
cb(null, [path, file]); | ||
}; | ||
stream.on("data", onData).on("end", onEnd); | ||
} catch (err) { | ||
@@ -39,0 +41,0 @@ return cb(err); |
{ | ||
"name": "then-busboy", | ||
"version": "2.0.0-beta.9", | ||
"version": "2.0.0-beta.10", | ||
"description": "Promise-based wrapper around Busboy. Process multipart/form-data content and returns it as a single object.", | ||
@@ -52,3 +52,2 @@ "repository": "octet-stream/then-busboy", | ||
"busboy": "0.2.14", | ||
"cloneable-readable": "1.0.0", | ||
"lodash.isplainobject": "4.0.6", | ||
@@ -55,0 +54,0 @@ "lodash.merge": "4.6.0", |
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
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
5
457
1
24064
- Removedcloneable-readable@1.0.0
- Removedcloneable-readable@1.0.0(transitive)
- Removedisarray@1.0.0(transitive)
- Removedprocess-nextick-args@1.0.72.0.1(transitive)
- Removedreadable-stream@2.3.8(transitive)
- Removedsafe-buffer@5.1.2(transitive)
- Removedstring_decoder@1.1.1(transitive)
- Removedthrough2@2.0.5(transitive)
- Removedutil-deprecate@1.0.2(transitive)
- Removedxtend@4.0.2(transitive)