From d48ef1a3ce63064f3c834de15c92c7ffc583252b Mon Sep 17 00:00:00 2001 From: David Anson Date: Mon, 23 Dec 2024 22:04:22 +0000 Subject: [PATCH] Freshen generated index.js file. --- dist/index.js | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/dist/index.js b/dist/index.js index f8ed712..b926e74 100644 --- a/dist/index.js +++ b/dist/index.js @@ -7782,19 +7782,19 @@ function queueAsPromised (context, worker, _concurrency) { } function drained () { - if (queue.idle()) { - return new Promise(function (resolve) { - resolve() - }) - } - - var previousDrain = queue.drain - var p = new Promise(function (resolve) { - queue.drain = function () { - previousDrain() - resolve() - } + process.nextTick(function () { + if (queue.idle()) { + resolve() + } else { + var previousDrain = queue.drain + queue.drain = function () { + if (typeof previousDrain === 'function') previousDrain() + resolve() + queue.drain = previousDrain + } + } + }) }) return p