@@ -31,6 +31,7 @@ import type { Response } from "./response.ts";
3131import { isNode } from "./utils/type_guards.ts" ;
3232import { decode } from "./utils/decode.ts" ;
3333import { resolvePath } from "./utils/resolve_path.ts" ;
34+ import type { Uint8ArrayArrayBuffer } from "./types.ts" ;
3435
3536if ( isNode ( ) ) {
3637 console . warn ( "oak send() does not work under Node.js." ) ;
@@ -137,9 +138,15 @@ async function getEntity(
137138 stats : Deno . FileInfo ,
138139 maxbuffer : number ,
139140 response : Response ,
140- ) : Promise < [ Uint8Array | Deno . FsFile , Uint8Array | FileInfo , FileInfo ] > {
141- let body : Uint8Array | Deno . FsFile ;
142- let entity : Uint8Array | FileInfo ;
141+ ) : Promise <
142+ [
143+ Uint8ArrayArrayBuffer | Deno . FsFile ,
144+ Uint8ArrayArrayBuffer | FileInfo ,
145+ FileInfo ,
146+ ]
147+ > {
148+ let body : Uint8ArrayArrayBuffer | Deno . FsFile ;
149+ let entity : Uint8ArrayArrayBuffer | FileInfo ;
143150 const fileInfo = { mtime : new Date ( mtime ) , size : stats . size } ;
144151 if ( stats . size < maxbuffer ) {
145152 const buffer = await Deno . readFile ( path ) ;
@@ -270,8 +277,8 @@ export async function send(
270277 : contentTypes [ extname ( path ) ] ?? extname ( path ) ;
271278 }
272279
273- let entity : Uint8Array | FileInfo | null = null ;
274- let body : Uint8Array | Deno . FsFile | null = null ;
280+ let entity : Uint8ArrayArrayBuffer | FileInfo | null = null ;
281+ let body : Uint8ArrayArrayBuffer | Deno . FsFile | null = null ;
275282 let fileInfo : FileInfo | null = null ;
276283
277284 if ( request . headers . has ( "If-None-Match" ) && mtime ) {
0 commit comments