@@ -24,7 +24,7 @@ export const NodeResponse: {
24
24
| Buffer
25
25
| Uint8Array
26
26
| DataView
27
- | ReadableStream < Uint8Array >
27
+ | ReadableStream
28
28
| NodeReadable
29
29
| undefined
30
30
| null ;
@@ -128,7 +128,7 @@ export const NodeResponse: {
128
128
body = bodyInit as NodeReadable ;
129
129
} else {
130
130
const res = new globalThis . Response ( bodyInit as BodyInit ) ;
131
- body = res . body ;
131
+ body = res . body as ReadableStream < Uint8Array < ArrayBuffer > > ;
132
132
for ( const [ key , value ] of res . headers ) {
133
133
headers . push ( [ key , value ] ) ;
134
134
}
@@ -254,15 +254,17 @@ export const NodeResponse: {
254
254
return false ; // Not supported
255
255
}
256
256
257
- get body ( ) : ReadableStream < Uint8Array > | null {
257
+ get body ( ) : ReadableStream < Uint8Array < ArrayBuffer > > | null {
258
258
if ( this . #responseObj) {
259
- return this . #responseObj. body ; // Reuse instance
259
+ return this . #responseObj. body as ReadableStream <
260
+ Uint8Array < ArrayBuffer >
261
+ > ; // Reuse instance
260
262
}
261
263
const fastBody = this . #fastBody( ReadableStream ) ;
262
264
if ( fastBody !== false ) {
263
- return fastBody as ReadableStream < Uint8Array > ; // Fast path
265
+ return fastBody as ReadableStream < Uint8Array < ArrayBuffer > > ; // Fast path
264
266
}
265
- return this . #response. body ; // Slow path
267
+ return this . #response. body as ReadableStream < Uint8Array < ArrayBuffer > > ; // Slow path
266
268
}
267
269
268
270
get bodyUsed ( ) : boolean {
@@ -296,13 +298,13 @@ export const NodeResponse: {
296
298
297
299
bytes ( ) : Promise < Uint8Array < ArrayBuffer > > {
298
300
if ( this . #responseObj) {
299
- return this . #responseObj. bytes ( ) ; // Reuse instance
301
+ return this . #responseObj. bytes ( ) as Promise < Uint8Array < ArrayBuffer > > ; // Reuse instance
300
302
}
301
303
const fastBody = this . #fastBody( Uint8Array ) ;
302
304
if ( fastBody !== false ) {
303
305
return Promise . resolve ( fastBody || new Uint8Array ( ) ) ; // Fast path
304
306
}
305
- return this . #response. bytes ( ) ; // Slow path
307
+ return this . #response. bytes ( ) as Promise < Uint8Array < ArrayBuffer > > ; // Slow path
306
308
}
307
309
308
310
formData ( ) : Promise < FormData > {
0 commit comments