From d0b666aa94f7c9a9bda537a82ce87fe4b6f71b39 Mon Sep 17 00:00:00 2001 From: David Anson Date: Tue, 14 Sep 2021 22:11:31 -0700 Subject: [PATCH] Update dependencies: @vercel/ncc to 0.31.1, eslint to 7.32.0, eslint-plugin-unicorn to 36.0.0. --- .eslintrc.json | 5 +++++ dist/index.js | 32 ++++++++++++++++++++++++++++++-- package.json | 6 +++--- 3 files changed, 38 insertions(+), 5 deletions(-) diff --git a/.eslintrc.json b/.eslintrc.json index 2385385..eaeb325 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -82,6 +82,7 @@ "unicorn/no-for-loop": "error", "unicorn/no-hex-escape": "error", "unicorn/no-instanceof-array": "error", + "unicorn/no-invalid-remove-event-listener": "error", "unicorn/no-keyword-prefix": "error", "unicorn/no-lonely-if": "error", "unicorn/no-nested-ternary": "error", @@ -95,6 +96,9 @@ "unicorn/no-unreadable-array-destructuring": "error", "unicorn/no-unsafe-regex": "error", "unicorn/no-unused-properties": "error", + "unicorn/no-useless-fallback-in-spread": "error", + "unicorn/no-useless-length-check": "error", + "unicorn/no-useless-spread": "error", "unicorn/no-useless-undefined": "error", "unicorn/no-zero-fractions": "error", "unicorn/number-literal-case": "error", @@ -120,6 +124,7 @@ "unicorn/prefer-negative-index": "error", "unicorn/prefer-node-protocol": "error", "unicorn/prefer-number-properties": "error", + "unicorn/prefer-object-from-entries": "error", "unicorn/prefer-object-has-own": "error", "unicorn/prefer-optional-catch-binding": "error", "unicorn/prefer-prototype-methods": "error", diff --git a/dist/index.js b/dist/index.js index 88cd9ec..1b15307 100644 --- a/dist/index.js +++ b/dist/index.js @@ -3838,11 +3838,12 @@ function queueAsPromised (context, worker, concurrency) { queue.push = push queue.unshift = unshift + queue.drained = drained return queue function push (value) { - return new Promise(function (resolve, reject) { + var p = new Promise(function (resolve, reject) { pushCb(value, function (err, result) { if (err) { reject(err) @@ -3851,10 +3852,17 @@ function queueAsPromised (context, worker, concurrency) { resolve(result) }) }) + + // Let's fork the promise chain to + // make the error bubble up to the user but + // not lead to a unhandledRejection + p.catch(noop) + + return p } function unshift (value) { - return new Promise(function (resolve, reject) { + var p = new Promise(function (resolve, reject) { unshiftCb(value, function (err, result) { if (err) { reject(err) @@ -3863,6 +3871,26 @@ function queueAsPromised (context, worker, concurrency) { resolve(result) }) }) + + // Let's fork the promise chain to + // make the error bubble up to the user but + // not lead to a unhandledRejection + p.catch(noop) + + return p + } + + function drained () { + var previousDrain = queue.drain + + var p = new Promise(function (resolve) { + queue.drain = function () { + previousDrain() + resolve() + } + }) + + return p } } diff --git a/package.json b/package.json index 3e02996..570c233 100644 --- a/package.json +++ b/package.json @@ -21,9 +21,9 @@ "markdownlint-cli2": "~0.1.3" }, "devDependencies": { - "@vercel/ncc": "~0.29.0", - "eslint": "~7.31.0", + "@vercel/ncc": "~0.31.1", + "eslint": "~7.32.0", "eslint-plugin-node": "~11.1.0", - "eslint-plugin-unicorn": "~34.0.1" + "eslint-plugin-unicorn": "~36.0.0" } }