File tree Expand file tree Collapse file tree 1 file changed +8
-5
lines changed Expand file tree Collapse file tree 1 file changed +8
-5
lines changed Original file line number Diff line number Diff line change @@ -100,13 +100,16 @@ function resolveCertOrKey(value?: unknown): undefined | string {
100100}
101101
102102export function createWaitUntil ( ) {
103- const promises = new Set < Promise < any > > ( ) ;
103+ const promises = new Set < Promise < any > | PromiseLike < any > > ( ) ;
104104 return {
105- waitUntil : ( promise : Promise < any > ) : void => {
105+ waitUntil : ( promise : Promise < any > | PromiseLike < any > ) : void => {
106+ if ( typeof promise ?. then !== "function" ) return ;
106107 promises . add (
107- promise . catch ( console . error ) . finally ( ( ) => {
108- promises . delete ( promise ) ;
109- } ) ,
108+ Promise . resolve ( promise )
109+ . catch ( console . error )
110+ . finally ( ( ) => {
111+ promises . delete ( promise ) ;
112+ } ) ,
110113 ) ;
111114 } ,
112115 wait : ( ) : Promise < any > => {
You can’t perform that action at this time.
0 commit comments