From 8a8bde9cde151c278397703c48f2bba4ded2bae7 Mon Sep 17 00:00:00 2001 From: Simon Grondin Date: Sat, 3 Aug 2019 12:09:21 -0500 Subject: [PATCH] 2.19.5 --- bower.json | 2 +- es5.js | 234 +++++++++++++++++++++++++++++----------------- lib/version.json | 2 +- light.js | 6 +- package-lock.json | 2 +- package.json | 2 +- 6 files changed, 157 insertions(+), 91 deletions(-) diff --git a/bower.json b/bower.json index ee2989d..b72e87e 100644 --- a/bower.json +++ b/bower.json @@ -1,7 +1,7 @@ { "name": "bottleneck", "main": "bottleneck.js", - "version": "2.19.4", + "version": "2.19.5", "homepage": "https://github.com/SGrondin/bottleneck", "authors": [ "SGrondin " diff --git a/es5.js b/es5.js index bc04727..a177b65 100644 --- a/es5.js +++ b/es5.js @@ -11,14 +11,14 @@ (global.Bottleneck = factory()); }(this, (function () { 'use strict'; - var commonjsGlobal = typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {}; + var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {}; function createCommonjsModule(fn, module) { return module = { exports: {} }, fn(module, module.exports), module.exports; } function getCjsExportFromNamespace (n) { - return n && n.default || n; + return n && n['default'] || n; } var runtime = createCommonjsModule(function (module) { @@ -1305,7 +1305,7 @@ return _context.stop(); } } - }, _callee, this, [[3, 14]]); + }, _callee, null, [[3, 14]]); })); return function (_x2) { @@ -1341,9 +1341,11 @@ }, _callee2, this, [[1, 13]]); })); - return function trigger(_x) { + function trigger(_x) { return _trigger.apply(this, arguments); - }; + } + + return trigger; }() }]); @@ -1656,9 +1658,11 @@ }, _callee, this, [[3, 15]]); })); - return function doExecute(_x, _x2, _x3, _x4) { + function doExecute(_x, _x2, _x3, _x4) { return _doExecute.apply(this, arguments); - }; + } + + return doExecute; }() }, { key: "doExpire", @@ -1729,9 +1733,11 @@ }, _callee2, this); })); - return function _onFailure(_x5, _x6, _x7, _x8, _x9) { + function _onFailure(_x5, _x6, _x7, _x8, _x9) { return _onFailure2.apply(this, arguments); - }; + } + + return _onFailure; }() }, { key: "doDone", @@ -1834,9 +1840,11 @@ }, _callee, this); })); - return function __publish__(_x) { + function __publish__(_x) { return _publish__.apply(this, arguments); - }; + } + + return __publish__; }() }, { key: "__disconnect__", @@ -1863,9 +1871,11 @@ }, _callee2, this); })); - return function __disconnect__(_x2) { + function __disconnect__(_x2) { return _disconnect__.apply(this, arguments); - }; + } + + return __disconnect__; }() }, { key: "yieldLoop", @@ -1911,9 +1921,11 @@ }, _callee3, this); })); - return function __updateSettings__(_x3) { + function __updateSettings__(_x3) { return _updateSettings__.apply(this, arguments); - }; + } + + return __updateSettings__; }() }, { key: "__running__", @@ -1939,9 +1951,11 @@ }, _callee4, this); })); - return function __running__() { + function __running__() { return _running__.apply(this, arguments); - }; + } + + return __running__; }() }, { key: "__queued__", @@ -1967,9 +1981,11 @@ }, _callee5, this); })); - return function __queued__() { + function __queued__() { return _queued__.apply(this, arguments); - }; + } + + return __queued__; }() }, { key: "__done__", @@ -1995,9 +2011,11 @@ }, _callee6, this); })); - return function __done__() { + function __done__() { return _done__.apply(this, arguments); - }; + } + + return __done__; }() }, { key: "__groupCheck__", @@ -2023,9 +2041,11 @@ }, _callee7, this); })); - return function __groupCheck__(_x4) { + function __groupCheck__(_x4) { return _groupCheck__.apply(this, arguments); - }; + } + + return __groupCheck__; }() }, { key: "computeCapacity", @@ -2081,9 +2101,11 @@ }, _callee8, this); })); - return function __incrementReservoir__(_x5) { + function __incrementReservoir__(_x5) { return _incrementReservoir__.apply(this, arguments); - }; + } + + return __incrementReservoir__; }() }, { key: "__currentReservoir__", @@ -2109,9 +2131,11 @@ }, _callee9, this); })); - return function __currentReservoir__() { + function __currentReservoir__() { return _currentReservoir__.apply(this, arguments); - }; + } + + return __currentReservoir__; }() }, { key: "isBlocked", @@ -2149,9 +2173,11 @@ }, _callee10, this); })); - return function __check__(_x6) { + function __check__(_x6) { return _check__.apply(this, arguments); - }; + } + + return __check__; }() }, { key: "__register__", @@ -2202,9 +2228,11 @@ }, _callee11, this); })); - return function __register__(_x7, _x8, _x9) { + function __register__(_x7, _x8, _x9) { return _register__.apply(this, arguments); - }; + } + + return __register__; }() }, { key: "strategyIsBlock", @@ -2259,9 +2287,11 @@ }, _callee12, this); })); - return function __submit__(_x10, _x11) { + function __submit__(_x10, _x11) { return _submit__.apply(this, arguments); - }; + } + + return __submit__; }() }, { key: "__free__", @@ -2294,9 +2324,11 @@ }, _callee13, this); })); - return function __free__(_x12, _x13) { + function __free__(_x12, _x13) { return _free__.apply(this, arguments); - }; + } + + return __free__; }() }]); @@ -2634,9 +2666,11 @@ }, _callee, this); })); - return function __runCommand__(_x) { + function __runCommand__(_x) { return _runCommand__.apply(this, arguments); - }; + } + + return __runCommand__; }() }, { key: "__addLimiter__", @@ -2703,7 +2737,7 @@ return _context2.stop(); } } - }, _callee2, this); + }, _callee2); })); return function (_x2) { @@ -2881,9 +2915,11 @@ }, _callee, this); })); - return function __runCommand__(_x) { + function __runCommand__(_x) { return _runCommand__.apply(this, arguments); - }; + } + + return __runCommand__; }() }, { key: "__addLimiter__", @@ -2930,7 +2966,7 @@ return _context2.stop(); } } - }, _callee2, this); + }, _callee2); })); return function (_x2) { @@ -3042,7 +3078,7 @@ var base; if (typeof (base = _this.heartbeat = setInterval(function () { - return _this.runScript("heartbeat", []).catch(function (e) { + return _this.runScript("heartbeat", [])["catch"](function (e) { return _this.instance.Events.trigger("error", e); }); }, _this.heartbeatInterval)).unref === "function") { @@ -3081,9 +3117,11 @@ }, _callee, this); })); - return function __publish__(_x) { + function __publish__(_x) { return _publish__.apply(this, arguments); - }; + } + + return __publish__; }() }, { key: "onMessage", @@ -3190,7 +3228,7 @@ return _context2.stop(); } } - }, _callee2, this, [[0, 9]]); + }, _callee2, null, [[0, 9]]); })), 1000)); case 35: @@ -3235,9 +3273,11 @@ }, _callee3, this, [[0, 47]]); })); - return function onMessage(_x2, _x3) { + function onMessage(_x2, _x3) { return _onMessage.apply(this, arguments); - }; + } + + return onMessage; }() }, { key: "__disconnect__", @@ -3285,7 +3325,7 @@ return resolve(replies); }); return _this3.connection.__scriptFn__(name).apply(void 0, _toConsumableArray(arr)); - }).catch(function (e) { + })["catch"](function (e) { if (e.message === "SETTINGS_KEY_NOT_FOUND") { if (name === "heartbeat") { return _this3.Promise.resolve(); @@ -3311,9 +3351,11 @@ }, _callee4, this); })); - return function runScript(_x4, _x5) { + function runScript(_x4, _x5) { return _runScript.apply(this, arguments); - }; + } + + return runScript; }() }, { key: "prepareArray", @@ -3383,9 +3425,11 @@ }, _callee5, this); })); - return function __updateSettings__(_x6) { + function __updateSettings__(_x6) { return _updateSettings__.apply(this, arguments); - }; + } + + return __updateSettings__; }() }, { key: "__running__", @@ -3428,9 +3472,11 @@ }, _callee6, this); })); - return function __groupCheck__() { + function __groupCheck__() { return _groupCheck__.apply(this, arguments); - }; + } + + return __groupCheck__; }() }, { key: "__incrementReservoir__", @@ -3468,9 +3514,11 @@ }, _callee7, this); })); - return function __check__(_x7) { + function __check__(_x7) { return _check__.apply(this, arguments); - }; + } + + return __check__; }() }, { key: "__register__", @@ -3507,9 +3555,11 @@ }, _callee8, this); })); - return function __register__(_x8, _x9, _x10) { + function __register__(_x8, _x9, _x10) { return _register__.apply(this, arguments); - }; + } + + return __register__; }() }, { key: "__submit__", @@ -3567,9 +3617,11 @@ }, _callee9, this, [[0, 11]]); })); - return function __submit__(_x11, _x12) { + function __submit__(_x11, _x12) { return _submit__.apply(this, arguments); - }; + } + + return __submit__; }() }, { key: "__free__", @@ -3599,9 +3651,11 @@ }, _callee10, this); })); - return function __free__(_x13, _x14) { + function __free__(_x13, _x14) { return _free__.apply(this, arguments); - }; + } + + return __free__; }() }]); @@ -3789,7 +3843,7 @@ return _context.stop(); } } - }, _callee, this, [[0, 7]]); + }, _callee, null, [[0, 7]]); }))(); case 9: @@ -3808,17 +3862,15 @@ }, _callee2, this); })); - return function _tryToRun() { + function _tryToRun() { return _tryToRun2.apply(this, arguments); - }; + } + + return _tryToRun; }() }, { key: "schedule", value: function schedule(task) { - for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) { - args[_key - 1] = arguments[_key]; - } - var promise, reject, resolve; resolve = reject = null; promise = new this.Promise(function (_resolve, _reject) { @@ -3826,6 +3878,10 @@ return reject = _reject; }); + for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) { + args[_key - 1] = arguments[_key]; + } + this._queue.push({ task: task, args: args, @@ -3844,7 +3900,7 @@ var Sync_1 = Sync; - var version = "2.19.4"; + var version = "2.19.5"; var version$1 = { version: version }; @@ -3964,9 +4020,11 @@ }, _callee, this); })); - return function deleteKey() { + function deleteKey() { return _deleteKey.apply(this, arguments); - }; + } + + return deleteKey; }() }, { key: "limiters", @@ -4050,9 +4108,11 @@ }, _callee2, this); })); - return function clusterKeys() { + function clusterKeys() { return _clusterKeys.apply(this, arguments); - }; + } + + return clusterKeys; }() }, { key: "_startAutoCleanup", @@ -4123,7 +4183,7 @@ return _context3.stop(); } } - }, _callee3, this, [[7, 17]]); + }, _callee3, null, [[7, 17]]); })), this.timeout / 2)).unref === "function" ? base.unref() : void 0; } }, { @@ -4471,9 +4531,11 @@ }, _callee, this, [[0, 10]]); })); - return function _free(_x, _x2, _x3, _x4) { + function _free(_x, _x2, _x3, _x4) { return _free2.apply(this, arguments); - }; + } + + return _free; }() }, { key: "_run", @@ -4572,7 +4634,7 @@ } else { return _this4.Promise.resolve(total); } - }).catch(function (e) { + })["catch"](function (e) { return _this4.Events.trigger("error", e); }); } @@ -4753,9 +4815,11 @@ }, _callee2, this, [[2, 11]]); })); - return function _addToQueue(_x5) { + function _addToQueue(_x5) { return _addToQueue2.apply(this, arguments); - }; + } + + return _addToQueue; }() }, { key: "_receive", @@ -4811,7 +4875,7 @@ job = new Job$1(task, args, options, this.jobDefaults, this.rejectOnDrop, this.Events, this._states, this.Promise); job.promise.then(function (args) { return typeof cb === "function" ? cb.apply(void 0, _toConsumableArray(args)) : void 0; - }).catch(function (args) { + })["catch"](function (args) { if (Array.isArray(args)) { return typeof cb === "function" ? cb.apply(void 0, _toConsumableArray(args)) : void 0; } else { @@ -4905,9 +4969,11 @@ }, _callee3, this); })); - return function updateSettings() { + function updateSettings() { return _updateSettings.apply(this, arguments); - }; + } + + return updateSettings; }() }, { key: "currentReservoir", @@ -4924,7 +4990,7 @@ return Bottleneck; }(); - Bottleneck.default = Bottleneck; + Bottleneck["default"] = Bottleneck; Bottleneck.Events = Events$6; Bottleneck.version = Bottleneck.prototype.version = require$$8.version; Bottleneck.strategy = Bottleneck.prototype.strategy = { diff --git a/lib/version.json b/lib/version.json index e735a4f..578a219 100644 --- a/lib/version.json +++ b/lib/version.json @@ -1 +1 @@ -{"version":"2.19.4"} +{"version":"2.19.5"} diff --git a/light.js b/light.js index b8c16bb..c4aa265 100644 --- a/light.js +++ b/light.js @@ -8,10 +8,10 @@ (global.Bottleneck = factory()); }(this, (function () { 'use strict'; - var commonjsGlobal = typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {}; + var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {}; function getCjsExportFromNamespace (n) { - return n && n.default || n; + return n && n['default'] || n; } var load = function(received, defaults, onto = {}) { @@ -803,7 +803,7 @@ var Sync_1 = Sync; - var version = "2.19.4"; + var version = "2.19.5"; var version$1 = { version: version }; diff --git a/package-lock.json b/package-lock.json index 901f1a8..e060b82 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "bottleneck", - "version": "2.19.4", + "version": "2.19.5", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index e13ec1c..b169997 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "bottleneck", - "version": "2.19.4", + "version": "2.19.5", "description": "Distributed task scheduler and rate limiter", "main": "lib/index.js", "typings": "bottleneck.d.ts",