Skip to content

Commit

Permalink
Fix breaking changes with new busboy version
Browse files Browse the repository at this point in the history
- No more constructor
- Truncated flags, encoding, and mime type information have been consolidated
into a single object passed to the event handlers
See: mscdex/busboy#266
  • Loading branch information
ostec-marten committed Jul 27, 2022
1 parent 3904884 commit a1b59f8
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion extract.js
Expand Up @@ -9,7 +9,8 @@ module.exports = function (req, dest, fnDestFilename, opts = {}) {
let fields = {}

let busboy = new Busboy(Object.assign({}, opts, {headers: req.headers}))
busboy.on('file', (fieldname, fileStream, filename, encoding, mimetype) => {
busboy.on('file', (fieldname, fileStream, info) => {
const { filename, encoding, mimeType } = info;
if (!filename) return fileStream.resume()

files.push(new Promise(function (resolve, reject) {
Expand Down

0 comments on commit a1b59f8

Please sign in to comment.