Skip to content
This repository has been archived by the owner on Feb 26, 2024. It is now read-only.

Commit

Permalink
remove Promise.allSettled shim
Browse files Browse the repository at this point in the history
  • Loading branch information
tenthirtyone committed Dec 8, 2022
1 parent ea24eff commit 907b767
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 12 deletions.
14 changes: 3 additions & 11 deletions src/packages/core/src/server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,6 @@ import {

import allSettled from "promise.allsettled";

// This `shim()` is necessary for `Promise.allSettled` to be shimmed
// in `node@10`. We cannot use `allSettled([...])` directly due to
// https://github.com/es-shims/Promise.allSettled/issues/5 without
// upgrading Typescript. TODO: if Typescript is upgraded to 4.2.3+
// then this line could be removed and `Promise.allSettled` below
// could replaced with `allSettled`.
allSettled.shim();

import AggregateError from "aggregate-error";
import type {
TemplatedApp,
Expand Down Expand Up @@ -225,7 +217,7 @@ export class Server<

this.#status = ServerStatus.opening;

const promise = Promise.allSettled([
const promise = allSettled([
this.#initializer,
new Promise(
(resolve: (listenSocket: false | us_listen_socket) => void) => {
Expand Down Expand Up @@ -263,10 +255,10 @@ export class Server<
const errors: Error[] = [];

if (promiseResults[0].status === "rejected") {
errors.push(promiseResults[0].reason);
errors.push(promiseResults[0].reason as Error);
}
if (promiseResults[1].status === "rejected") {
errors.push(promiseResults[1].reason);
errors.push(promiseResults[1].reason as Error);
}

if (errors.length === 0) {
Expand Down
2 changes: 1 addition & 1 deletion src/packages/ganache/npm-shrinkwrap.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 907b767

Please sign in to comment.