File tree Expand file tree Collapse file tree 1 file changed +12
-15
lines changed
Expand file tree Collapse file tree 1 file changed +12
-15
lines changed Original file line number Diff line number Diff line change @@ -291,23 +291,20 @@ class AbstractLevel extends EventEmitter {
291291 // In parallel so that all resources know they are closed
292292 const resources = Array . from ( this . #resources)
293293 const promises = resources . map ( closeResource )
294-
295- // TODO: async/await
296- return Promise . allSettled ( promises ) . then ( async ( results ) => {
297- const errors = [ ]
298-
299- for ( let i = 0 ; i < results . length ; i ++ ) {
300- if ( results [ i ] . status === 'fulfilled' ) {
301- this . #resources. delete ( resources [ i ] )
302- } else {
303- errors . push ( convertRejection ( results [ i ] . reason ) )
304- }
294+ const results = await Promise . allSettled ( promises )
295+ const errors = [ ]
296+
297+ for ( let i = 0 ; i < results . length ; i ++ ) {
298+ if ( results [ i ] . status === 'fulfilled' ) {
299+ this . #resources. delete ( resources [ i ] )
300+ } else {
301+ errors . push ( convertRejection ( results [ i ] . reason ) )
305302 }
303+ }
306304
307- if ( errors . length > 0 ) {
308- throw combineErrors ( errors )
309- }
310- } )
305+ if ( errors . length > 0 ) {
306+ throw combineErrors ( errors )
307+ }
311308 }
312309
313310 async _close ( ) { }
You can’t perform that action at this time.
0 commit comments