{
  "version": 3,
  "sources": ["../../src/jsutils/promiseForObject.ts"],
  "sourcesContent": ["import type { ObjMap } from \"./ObjMap\";\n\n/**\n * This function transforms a JS object `ObjMap<Promise<T>>` into\n * a `Promise<ObjMap<T>>`\n *\n * This is akin to bluebird's `Promise.props`, but implemented only using\n * `Promise.all` so it will work with any implementation of ES6 promises.\n */\nexport function promiseForObject<T>(\n  object: ObjMap<Promise<T>>,\n): Promise<ObjMap<T>> {\n  return Promise.all(Object.values(object)).then((resolvedValues) => {\n    const resolvedObject = Object.create(null);\n    for (const [i, key] of Object.keys(object).entries()) {\n      resolvedObject[key] = resolvedValues[i];\n    }\n    return resolvedObject;\n  });\n}\n"],
  "mappings": ";AASO,SAAS,iBACd,QACoB;AACpB,SAAO,QAAQ,IAAI,OAAO,OAAO,MAAM,CAAC,EAAE,KAAK,CAAC,mBAAmB;AACjE,UAAM,iBAAiB,uBAAO,OAAO,IAAI;AACzC,eAAW,CAAC,GAAG,GAAG,KAAK,OAAO,KAAK,MAAM,EAAE,QAAQ,GAAG;AACpD,qBAAe,GAAG,IAAI,eAAe,CAAC;AAAA,IACxC;AACA,WAAO;AAAA,EACT,CAAC;AACH;",
  "names": []
}
