MCPcopy
hub / github.com/vitejs/vite / asyncFlatten

Function asyncFlatten

packages/vite/src/node/utils.ts:1597–1604  ·  view source on GitHub ↗
(
  arr: T,
)

Source from the content-addressed store, hash-verified

1595 : never
1596
1597export async function asyncFlatten<T extends unknown[]>(
1598 arr: T,
1599): Promise<AsyncFlatten<T>> {
1600 do {
1601 arr = (await Promise.all(arr)).flat(Infinity) as any
1602 } while (arr.some((v: any) => v?.then))
1603 return arr as unknown[] as AsyncFlatten<T>
1604}
1605
1606// strip UTF-8 BOM
1607export function stripBomTag(content: string): string {

Callers 10

resolveConfigFunction · 0.90
createWorkerPluginsFunction · 0.90
resolveBuildPluginsFunction · 0.90
getRolldownOptionsMethod · 0.90
utils.spec.tsFile · 0.90
extractExportsDataFunction · 0.90
prepareRolldownScannerFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected