diff --git a/dist/index.js b/dist/index.js index b555e947bd..d20f16fa2a 100644 --- a/dist/index.js +++ b/dist/index.js @@ -35664,7 +35664,8 @@ __nccwpck_require__.r(__webpack_exports__); // EXPORTS __nccwpck_require__.d(__webpack_exports__, { - "default": () => (/* binding */ pLimit) + "default": () => (/* binding */ pLimit), + limitFunction: () => (/* binding */ limitFunction) }); ;// CONCATENATED MODULE: ./node_modules/yocto-queue/index.js @@ -35840,6 +35841,13 @@ function pLimit(concurrency) { return generator; } +function limitFunction(function_, option) { + const {concurrency} = option; + const limit = pLimit(concurrency); + + return (...arguments_) => limit(() => function_(...arguments_)); +} + function validateConcurrency(concurrency) { if (!((Number.isInteger(concurrency) || concurrency === Number.POSITIVE_INFINITY) && concurrency > 0)) { throw new TypeError('Expected `concurrency` to be a number from 1 and up');