{"code":"import isPromise from '../isPromise';\r\n/**\r\n * Maps over an array of promises like Array.map()\r\n * If the input array is not one of promises, the mapper function can be used\r\n * to map them first before mapping over them using Promise.all()\r\n */\r\nconst mapPromise = (inputs, mapper) => {\r\n    const promises = [];\r\n    inputs.forEach(i => isPromise(i)\r\n        ? promises.push(i)\r\n        : promises.push(mapper(i)));\r\n    return Promise.all(promises);\r\n};\r\nexport default mapPromise;\r\n//# sourceMappingURL=index.js.map","map":"{\"version\":3,\"file\":\"index.js\",\"sourceRoot\":\"\",\"sources\":[\"../../../../src/async/mapPromise/index.ts\"],\"names\":[],\"mappings\":\"AAAA,OAAO,SAAS,MAAM,cAAc,CAAC;AAIrC;;;;GAIG;AACH,MAAM,UAAU,GAAG,CAAC,MAAa,EAAE,MAAuB,EAAE,EAAE;IAC5D,MAAM,QAAQ,GAAG,EAAE,CAAC;IAEpB,MAAM,CAAC,OAAO,CACZ,CAAC,CAAC,EAAE,CAAC,SAAS,CAAC,CAAC,CAAC;QACf,CAAC,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC;QAClB,CAAC,CAAC,QAAQ,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAC7B,CAAC;IAEF,OAAO,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;AAC/B,CAAC,CAAC;AACF,eAAe,UAAU,CAAC\"}","dts":{"name":"/Users/thibault/Development/pure-fun/async/mapPromise/index.d.ts","writeByteOrderMark":false,"text":"declare type MappingFunction = (i: Promise<any>) => void;\r\n/**\r\n * Maps over an array of promises like Array.map()\r\n * If the input array is not one of promises, the mapper function can be used\r\n * to map them first before mapping over them using Promise.all()\r\n */\r\ndeclare const mapPromise: (inputs: any[], mapper: MappingFunction) => Promise<any[]>;\r\nexport default mapPromise;\r\n"}}
