(chunk, options = kNullPrototo)
| 879 | return { |
| 880 | __proto__: null, |
| 881 | write(chunk, options = kNullPrototo) { |
| 882 | if (error) { |
| 883 | return PromiseReject(error); |
| 884 | } |
| 885 | if (closed) { |
| 886 | return PromiseReject( |
| 887 | new ERR_INVALID_STATE.TypeError('The writer is closed')); |
| 888 | } |
| 889 | validateObject(options, 'options'); |
| 890 | const { |
| 891 | signal, |
| 892 | } = options; |
| 893 | if (signal !== undefined) { |
| 894 | validateAbortSignal(signal, 'options.signal'); |
| 895 | if (signal.aborted) { |
| 896 | return PromiseReject(signal.reason); |
| 897 | } |
| 898 | } |
| 899 | chunk = newStreamsToUint8Array(chunk); |
| 900 | if (bytesRemaining >= 0 && chunk.byteLength > bytesRemaining) { |
| 901 | return PromiseReject( |
| 902 | new ERR_OUT_OF_RANGE('write', `<= ${bytesRemaining} bytes`, |
| 903 | chunk.byteLength)); |
| 904 | } |
| 905 | if (bytesRemaining > 0) bytesRemaining -= chunk.byteLength; |
| 906 | const position = pos; |
| 907 | if (pos >= 0) pos += chunk.byteLength; |
| 908 | return writeAll(chunk, 0, chunk.byteLength, position, signal); |
| 909 | }, |
| 910 | |
| 911 | writev(chunks, options = kNullPrototo) { |
| 912 | if (error) { |
no test coverage detected
searching dependent graphs…