Skip to content

Commit

Permalink
fix: revert allSettled polyfill temporarily
Browse files Browse the repository at this point in the history
  • Loading branch information
danielroe committed Jun 9, 2020
1 parent dafc315 commit 3d136f2
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions packages/core/src/utils.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
import _esm from 'esm'
import _glob from 'glob'
import { loadAllSettled, loadFromEntries } from './polyfills'
import { loadFromEntries } from './polyfills'

const esm = _esm(module)

if (!Object.fromEntries) loadFromEntries()
if (!Promise.allSettled) loadAllSettled()

export const glob = (pattern: string) =>
new Promise<string[]>((resolve, reject) =>
Expand Down Expand Up @@ -64,7 +63,7 @@ export const includeIf = <T>(test: any, item: T) => (test ? [item] : [])
export const runInParallel = async <T, R extends any>(
items: T[],
cb: (item: T) => Promise<R>
) => Promise.allSettled(items.map(async item => cb(item)))
) => Promise.all(items.map(async item => cb(item)))

export const asArray = <T>(item: T | T[] | undefined): T[] =>
item !== undefined ? (Array.isArray(item) ? item : [item]) : []

0 comments on commit 3d136f2

Please sign in to comment.