Method
write
(chunk: Uint8Array | string)
Source from the content-addressed store, hash-verified
| 100 | } |
| 101 | |
| 102 | write(chunk: Uint8Array | string): boolean { |
| 103 | if (this._closed) throw new Error('Writer is closed'); |
| 104 | const bytes = typeof chunk === 'string' ? this.enc.encode(chunk) : chunk; |
| 105 | this.chunks.push(bytes); |
| 106 | this._byteCount += bytes.byteLength; |
| 107 | return true; |
| 108 | } |
| 109 | |
| 110 | writev(chunks: (Uint8Array | string)[]): boolean { |
| 111 | for (const chunk of chunks) { |
Tested by
no test coverage detected