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

Method _flush

src/parsers/StreamingQuerystring.js:77–93  ·  view source on GitHub ↗
(callback)

Source from the content-addressed store, hash-verified

75 }
76
77 _flush(callback) {
78 // Emit the last field
79 if (this.readingKey) {
80 // we only have a key if there's something in the buffer. We definitely have no value
81 if (this.buffer && this.buffer.length) {
82 this.emitField(this.buffer.toString('ascii'));
83 }
84 } else {
85 // We have a key, we may or may not have a value
86 this.emitField(
87 this.key,
88 this.buffer && this.buffer.length && this.buffer.toString('ascii'),
89 );
90 }
91 this.buffer = '';
92 callback();
93 }
94
95 getSection(buffer, i) {
96 if (i === this.sectionStart) return '';

Callers

nothing calls this directly

Calls 3

emitFieldMethod · 0.95
callbackFunction · 0.85
toStringMethod · 0.45

Tested by

no test coverage detected