Skip to content

Commit 5706c14

Browse files
authored
fix: add missing error (#794)
* fix: add missing error * refactor: be more explicit about object signature * docs: changelog
1 parent 1b27107 commit 5706c14

File tree

4 files changed

+12
-2
lines changed

4 files changed

+12
-2
lines changed

CHANGELOG.md

+5
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
# Changelog
22

3+
### 3.1.4
4+
5+
* fix: add missing pluginFailed error ([#794](https://github.com/node-formidable/formidable/pull/794))
6+
* refactor: use explicit node imports (#786)
7+
38
### 3.1.1
49

510
* feat: handle top level json array, string and number

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "formidable",
3-
"version": "3.1.3",
3+
"version": "3.1.4",
44
"license": "MIT",
55
"description": "A node.js module for parsing form data, especially file uploads.",
66
"homepage": "https://github.com/node-formidable/formidable",

src/Formidable.js

+4-1
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,10 @@ const DEFAULT_OPTIONS = {
3030
enabledPlugins: [octetstream, querystring, multipart, json],
3131
fileWriteStreamHandler: null,
3232
defaultInvalidName: 'invalid-name',
33-
filter() {
33+
filter(_part) {
3434
return true;
3535
},
36+
filename: undefined,
3637
};
3738

3839
function hasOwnProp(obj, key) {
@@ -88,6 +89,8 @@ class IncomingForm extends EventEmitter {
8889
});
8990

9091
this._setUpMaxFields();
92+
this.ended = undefined;
93+
this.type = undefined;
9194
}
9295

9396
use(plugin) {

src/FormidableError.js

+2
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ const missingContentType = 1011;
1313
const malformedMultipart = 1012;
1414
const missingMultipartBoundary = 1013;
1515
const unknownTransferEncoding = 1014;
16+
const pluginFailed = 1017;
1617

1718
const FormidableError = class extends Error {
1819
constructor(message, internalCode, httpCode = 500) {
@@ -38,6 +39,7 @@ export {
3839
malformedMultipart,
3940
missingMultipartBoundary,
4041
unknownTransferEncoding,
42+
pluginFailed,
4143
};
4244

4345
export default FormidableError;

0 commit comments

Comments
 (0)