diff --git a/src/util/index.ts b/src/util/index.ts index 5338c651d7..9604be53fe 100644 --- a/src/util/index.ts +++ b/src/util/index.ts @@ -29,7 +29,9 @@ import chalk from "chalk" import hasAnsi = require("has-ansi") // shim to allow async generator functions -(Symbol).asyncIterator = (Symbol).asyncIterator || Symbol.for("Symbol.asyncIterator") +if (typeof (Symbol as any).asyncIterator === "undefined") { + (Symbol as any).asyncIterator = Symbol("asyncIterator") +} export type HookCallback = (callback?: () => void) => void