From dfce56cee8023ce0dc9292e0c1dda5e6937910e5 Mon Sep 17 00:00:00 2001 From: Julien Fontanet Date: Mon, 4 Jul 2022 17:37:52 +0200 Subject: [PATCH] feat(async-each): add basic JsDoc typing --- @vates/async-each/index.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/@vates/async-each/index.js b/@vates/async-each/index.js index 61ff415be..0a291a6e1 100644 --- a/@vates/async-each/index.js +++ b/@vates/async-each/index.js @@ -9,6 +9,12 @@ class AggregateError extends Error { } } +/** + * @template Item + * @param {Iterable} iterable + * @param {(item: Item, index: number, iterable: Iterable) => Promise} iteratee + * @returns {Promise} + */ exports.asyncEach = function asyncEach(iterable, iteratee, { concurrency = 1, signal, stopOnError = true } = {}) { if (concurrency === 0) { concurrency = Infinity