diff --git a/@xen-orchestra/async-map/index.js b/@xen-orchestra/async-map/index.js index f25de2f97a..8c142628a6 100644 --- a/@xen-orchestra/async-map/index.js +++ b/@xen-orchestra/async-map/index.js @@ -13,11 +13,11 @@ const wrapCall = (fn, arg, thisArg) => { * * WARNING: Does not handle plain objects * - * @template Item,This + * @template Item, Result, [This=Iterable] * @param {Iterable} iterable - * @param {(this: This, item: Item) => (Item | PromiseLike)} mapFn - * @param {This} [thisArg] - * @returns {Promise} + * @param {(this: This, item: Item) => (Result | PromiseLike)} mapFn + * @param {This} [thisArg] defaults to `iterable` + * @returns {Promise} */ exports.asyncMap = function asyncMap(iterable, mapFn, thisArg = iterable) { return Promise.all(Array.from(iterable, mapFn, thisArg)) @@ -26,11 +26,11 @@ exports.asyncMap = function asyncMap(iterable, mapFn, thisArg = iterable) { /** * Like `asyncMap` but wait for all promises to settle before rejecting * - * @template Item,This + * @template Item, Result, [This=Iterable] * @param {Iterable} iterable - * @param {(this: This, item: Item) => (Item | PromiseLike)} mapFn - * @param {This} [thisArg] - * @returns {Promise} + * @param {(this: This, item: Item) => (Result | PromiseLike)} mapFn + * @param {This} [thisArg] defaults to `iterable` + * @returns {Promise} */ exports.asyncMapSettled = function asyncMapSettled(iterable, mapFn, thisArg = iterable) { return new Promise((resolve, reject) => { diff --git a/CHANGELOG.unreleased.md b/CHANGELOG.unreleased.md index 90a3778ade..3861f43367 100644 --- a/CHANGELOG.unreleased.md +++ b/CHANGELOG.unreleased.md @@ -42,6 +42,7 @@ - @xen-orchestra/acl minor +- @xen-orchestra/async-map patch - @xen-orchestra/proxy-cli patch - @xen-orchestra/rest-api minor - @xen-orchestra/upload-ova patch