diff --git a/lib/destination-claim.js b/lib/destination-claim.js index 42c427a8..21fe3f07 100644 --- a/lib/destination-claim.js +++ b/lib/destination-claim.js @@ -45,7 +45,7 @@ function * ancestors (path) { /** @param {FileHandle[]} handles */ async function closeHandles (handles) { - const closed = await Promise.allSettled(handles.reverse().map(handle => handle.close())) + const closed = await Promise.allSettled(handles.toReversed().map(handle => handle.close())) const errors = closed.flatMap(result => result.status === 'rejected' ? [result.reason] : []) if (errors.length > 0) throw new AggregateError(errors, 'Could not release domstack destination locks') }