()
| 637 | } |
| 638 | |
| 639 | _setUpMaxFields() { |
| 640 | if (this.options.maxFields !== Infinity) { |
| 641 | let fieldsCount = 0; |
| 642 | this.on('field', () => { |
| 643 | fieldsCount += 1; |
| 644 | if (fieldsCount > this.options.maxFields) { |
| 645 | this._error( |
| 646 | new FormidableError( |
| 647 | `options.maxFields (${this.options.maxFields}) exceeded`, |
| 648 | errors.maxFieldsExceeded, |
| 649 | 413, |
| 650 | ), |
| 651 | ); |
| 652 | } |
| 653 | }); |
| 654 | } |
| 655 | } |
| 656 | |
| 657 | _setUpMaxFiles() { |
| 658 | if (this.options.maxFiles !== Infinity) { |