MCPcopy Create free account
hub / github.com/contentlayerdev/contentlayer / promiseMap

Function promiseMap

packages/@contentlayer/utils/src/promise.ts:2–3  ·  view source on GitHub ↗
(arr: T[], map: (el: T, index?: number) => Res | Promise<Res>)

Source from the content-addressed store, hash-verified

1/** Promise.all + Array.map */
2export const promiseMap = <T, Res>(arr: T[], map: (el: T, index?: number) => Res | Promise<Res>) =>
3 Promise.all(arr.map(map))
4
5export const promiseMapDict = async <T, Res>(
6 dict: Record<string, T>,

Callers

nothing calls this directly

Calls 1

mapMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…