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

Method _flush

src/parsers/Multipart.js:70–83  ·  view source on GitHub ↗
(done)

Source from the content-addressed store, hash-verified

68 }
69
70 _flush(done) {
71 if (
72 (this.state === STATE.HEADER_FIELD_START && this.index === 0) ||
73 (this.state === STATE.PART_DATA && this.index === this.boundary.length)
74 ) {
75 this._handleCallback('partEnd');
76 this._handleCallback('end');
77 done();
78 } else if (this.state !== STATE.END) {
79 done(this._endUnexpected());
80 } else {
81 done();
82 }
83 }
84
85 initWithBoundary(str) {
86 this.boundary = Buffer.from(`\r\n--${str}`);

Callers

nothing calls this directly

Calls 3

_handleCallbackMethod · 0.95
_endUnexpectedMethod · 0.95
doneFunction · 0.85

Tested by

no test coverage detected