MCPcopy Create free account
hub / github.com/nodejs/node / writeSync

Method writeSync

lib/internal/streams/iter/broadcast.js:595–605  ·  view source on GitHub ↗
(chunk)

Source from the content-addressed store, hash-verified

593 }
594
595 writeSync(chunk) {
596 if (this.#isClosedOrAborted()) return false;
597 if (!this.#broadcast[kCanWrite]()) return false;
598 const converted =
599 toUint8Array(chunk);
600 if (this.#broadcast[kWrite]([converted])) {
601 this.#totalBytes += TypedArrayPrototypeGetByteLength(converted);
602 return true;
603 }
604 return false;
605 }
606
607 writevSync(chunks) {
608 if (!ArrayIsArray(chunks)) {

Callers 1

pumpFunction · 0.45

Calls 2

#isClosedOrAbortedMethod · 0.95
toUint8ArrayFunction · 0.85

Tested by

no test coverage detected