Skip to content

Commit

Permalink
refactor: Make AsyncResult a PromiseLike (renovatebot#23501)
Browse files Browse the repository at this point in the history
  • Loading branch information
zharinov committed Jul 22, 2023
1 parent 2e03c0f commit 208f0fb
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions lib/util/result.ts
Original file line number Diff line number Diff line change
Expand Up @@ -561,6 +561,7 @@ export class AsyncResult<T, E> implements PromiseLike<Result<T, E>> {
) => Result<U, E | EE> | AsyncResult<U, E | EE> | Promise<Result<U, E | EE>>
): AsyncResult<T | U, E | EE> {
const caughtAsyncResult = this.asyncResult.then((result) =>
// eslint-disable-next-line promise/no-nesting
result.catch(fn as never)
);
return AsyncResult.wrap(caughtAsyncResult);
Expand Down

0 comments on commit 208f0fb

Please sign in to comment.