From a1b59f817c3b5d68f9a03ed6df0a99ffd27276c2 Mon Sep 17 00:00:00 2001 From: ostec-marten <99991587+ostec-marten@users.noreply.github.com> Date: Wed, 27 Jul 2022 14:51:09 +0200 Subject: [PATCH] Fix breaking changes with new busboy version - No more constructor - Truncated flags, encoding, and mime type information have been consolidated into a single object passed to the event handlers See: https://github.com/mscdex/busboy/issues/266 --- extract.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/extract.js b/extract.js index 18e614e..451dab2 100644 --- a/extract.js +++ b/extract.js @@ -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) {