File tree Expand file tree Collapse file tree 2 files changed +11
-9
lines changed Expand file tree Collapse file tree 2 files changed +11
-9
lines changed Original file line number Diff line number Diff line change @@ -17,9 +17,9 @@ export default async function edgeFunctionHandler(
1717    throw  new  Error ( `No route found for ${ request . url }  ) ; 
1818  } 
1919
20-   const  result  =  await  self . _ENTRIES [ 
21-      `middleware_ ${ correspondingRoute . name } ` 
22-   ] . default ( { 
20+   const  entry  =  await  self . _ENTRIES [ `middleware_ ${ correspondingRoute . name } ` ] ; 
21+ 
22+   const   result   =   await   entry . default ( { 
2323    page : correspondingRoute . page , 
2424    request : { 
2525      ...request , 
Original file line number Diff line number Diff line change @@ -37,13 +37,15 @@ export interface RequestData {
3737  signal : AbortSignal ; 
3838} 
3939
40+ interface  Entry  { 
41+   default : ( props : {  page : string ;  request : RequestData  } )  =>  Promise < { 
42+     response : Response ; 
43+     waitUntil : Promise < void > ; 
44+   } > ; 
45+ } 
46+ 
4047interface  Entries  { 
41-   [ k : string ] : { 
42-     default : ( props : {  page : string ;  request : RequestData  } )  =>  Promise < { 
43-       response : Response ; 
44-       waitUntil : Promise < void > ; 
45-     } > ; 
46-   } ; 
48+   [ k : string ] : Entry  |  Promise < Entry > ; 
4749} 
4850
4951export  interface  EdgeRoute  { 
 
 
   
 
     
   
   
          
    
    
     
    
      
     
     
    You can’t perform that action at this time.
  
 
    
  
    
      
        
     
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments