diff --git a/CHANGELOG.md b/CHANGELOG.md index b231847c..a8b552ec 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ # Changelog +### 3.5.2 + + * fix: ([#982](https://github.com/node-formidable/formidable/pull/982)) make it easier to import hexoid with webpack + ### 3.5.1 * fix: ([#945](https://github.com/node-formidable/formidable/pull/945)) multipart parser fix: flush or fail always (don't hang) diff --git a/package.json b/package.json index 0561e069..4daa709b 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "formidable", - "version": "3.5.1", + "version": "3.5.2", "license": "MIT", "description": "A node.js module for parsing form data, especially file uploads.", "homepage": "https://github.com/node-formidable/formidable", @@ -66,7 +66,7 @@ }, "dependencies": { "dezalgo": "^1.0.4", - "hexoid": "^1.0.0", + "hexoid": "^2.0.0", "once": "^1.4.0" }, "devDependencies": { diff --git a/src/Formidable.js b/src/Formidable.js index 0e9a1536..7cc722bf 100644 --- a/src/Formidable.js +++ b/src/Formidable.js @@ -6,7 +6,7 @@ import path from 'node:path'; import fsPromises from 'node:fs/promises'; import { EventEmitter } from 'node:events'; import { StringDecoder } from 'node:string_decoder'; -import hexoid from 'hexoid'; +import { hexoid } from 'hexoid'; import once from 'once'; import dezalgo from 'dezalgo'; import { octetstream, querystring, multipart, json } from './plugins/index.js'; @@ -187,7 +187,7 @@ class IncomingForm extends EventEmitter { if (!cb) { let resolveRef; let rejectRef; - promise = new Promise((resolve, reject) => { + promise = new Promise((resolve, reject) => { resolveRef = resolve; rejectRef = reject; }); @@ -380,7 +380,7 @@ class IncomingForm extends EventEmitter { part.on('data', (buffer) => { this._totalFileSize += buffer.length; fileSize += buffer.length; - + if (this._totalFileSize > this.options.maxTotalFileSize) { this._error( new FormidableError( diff --git a/yarn.lock b/yarn.lock index 3ecef30f..9434db9e 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2638,10 +2638,10 @@ hasha@^5.0.0: is-stream "^2.0.0" type-fest "^0.8.0" -hexoid@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/hexoid/-/hexoid-1.0.0.tgz#ad10c6573fb907de23d9ec63a711267d9dc9bc18" - integrity sha512-QFLV0taWQOZtvIRIAdBChesmogZrtuXvVWsFHZTk2SU+anspqZ2vMnoLg7IE1+Uk16N19APic1BuF8bC8c2m5g== +hexoid@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/hexoid/-/hexoid-2.0.0.tgz#fb36c740ebbf364403fa1ec0c7efd268460ec5b9" + integrity sha512-qlspKUK7IlSQv2o+5I7yhUd7TxlOG2Vr5LTa3ve2XSNVKAL/n/u/7KLvKmFNimomDIKvZFXWHv0T12mv7rT8Aw== hosted-git-info@^2.1.4: version "2.8.9"