MCPcopy
hub / github.com/node-formidable/formidable / _setUpMaxFiles

Method _setUpMaxFiles

src/Formidable.js:657–673  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

655 }
656
657 _setUpMaxFiles() {
658 if (this.options.maxFiles !== Infinity) {
659 let fileCount = 0;
660 this.on('fileBegin', () => {
661 fileCount += 1;
662 if (fileCount > this.options.maxFiles) {
663 this._error(
664 new FormidableError(
665 `options.maxFiles (${this.options.maxFiles}) exceeded`,
666 errors.maxFilesExceeded,
667 413,
668 ),
669 );
670 }
671 });
672 }
673 }
674
675 _maybeEnd() {
676 if (!this.ended || this._flushing || this.error) {

Callers 1

constructorMethod · 0.95

Calls 1

_errorMethod · 0.95

Tested by

no test coverage detected