()
| 322 | |
| 323 | private arrayBufferBody?: Effect.Effect<ArrayBuffer, Error.HttpClientError> |
| 324 | get arrayBuffer(): Effect.Effect<ArrayBuffer, Error.HttpClientError> { |
| 325 | if (this.arrayBufferBody) { |
| 326 | return this.arrayBufferBody |
| 327 | } |
| 328 | this.arrayBufferBody = Effect.tryPromise({ |
| 329 | try: () => this.source.body.arrayBuffer(), |
| 330 | catch: (cause) => |
| 331 | new Error.HttpClientError({ |
| 332 | reason: new Error.DecodeError({ |
| 333 | request: this.request, |
| 334 | response: this, |
| 335 | cause |
| 336 | }) |
| 337 | }) |
| 338 | }).pipe(Effect.cached, Effect.runSync) |
| 339 | this.textBody = Effect.map(this.arrayBufferBody, (_) => new TextDecoder().decode(_)) |
| 340 | return this.arrayBufferBody |
| 341 | } |
| 342 | |
| 343 | toJSON(): unknown { |
| 344 | return IncomingMessage.inspect(this, { |
no test coverage detected