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

Method end

lib/internal/streams/fast-utf8-stream.js:298–325  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

296 }
297
298 end() {
299 if (this.#destroyed) {
300 throw new ERR_INVALID_STATE('Utf8Stream is destroyed');
301 }
302
303 if (this.#opening) {
304 this.once('ready', () => {
305 this.end();
306 });
307 return;
308 }
309
310 if (this.#ending) {
311 return;
312 }
313
314 this.#ending = true;
315
316 if (this.#writing) {
317 return;
318 }
319
320 if (this.#len > 0 && this.#fd >= 0) {
321 this.#actualWrite();
322 } else {
323 this.#actualClose();
324 }
325 }
326
327 destroy() {
328 if (this.#destroyed) {

Callers 10

runTestsFunction · 0.95
runTestsFunction · 0.95
runTestsFunction · 0.95
runTestsFunction · 0.95
runTestsFunction · 0.95
runTestsFunction · 0.95
runTestsFunction · 0.95
runTestsFunction · 0.95
runTestsFunction · 0.95
runTestsFunction · 0.95

Calls 2

#actualCloseMethod · 0.95
onceMethod · 0.45

Tested by

no test coverage detected