MCPcopy Index your code
hub / github.com/nodejs/node / final

Function final

lib/internal/streams/transform.js:126–152  ·  view source on GitHub ↗
(cb)

Source from the content-addressed store, hash-verified

124}
125
126function final(cb) {
127 if (typeof this._flush === 'function' && !this.destroyed) {
128 this._flush((er, data) => {
129 if (er) {
130 if (cb) {
131 cb(er);
132 } else {
133 this.destroy(er);
134 }
135 return;
136 }
137
138 if (data != null) {
139 this.push(data);
140 }
141 this.push(null);
142 if (cb) {
143 cb();
144 }
145 });
146 } else {
147 this.push(null);
148 if (cb) {
149 cb();
150 }
151 }
152}
153
154function prefinish() {
155 if (this._final !== final) {

Callers

nothing calls this directly

Calls 4

_flushMethod · 0.80
cbFunction · 0.70
destroyMethod · 0.45
pushMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…