MCPcopy Create free account
hub / github.com/node-formidable/formidable / _setUpMaxFields

Method _setUpMaxFields

src/Formidable.js:639–655  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

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) {

Callers 1

constructorMethod · 0.95

Calls 1

_errorMethod · 0.95

Tested by

no test coverage detected