@jcoreio/async-throttle
Advanced tools
Comparing version 1.4.4 to 1.4.5
@@ -72,5 +72,5 @@ "use strict"; | ||
async function wrapper(...args) { | ||
function wrapper(...args) { | ||
nextArgs = nextArgs ? getNextArgs(nextArgs, args) : args; | ||
if (!nextArgs) throw new Error('unexpected error: nextArgs is null'); | ||
if (!nextArgs) return Promise.reject(new Error('unexpected error: nextArgs is null')); | ||
if (nextInvocation) return nextInvocation; | ||
@@ -77,0 +77,0 @@ return nextInvocation = (delay || Promise.resolve()).then(invoke); |
52
index.js
@@ -137,48 +137,10 @@ "use strict"; | ||
function wrapper() { | ||
return _wrapper.apply(this, arguments); | ||
} | ||
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { | ||
args[_key] = arguments[_key]; | ||
} | ||
function _wrapper() { | ||
_wrapper = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee4() { | ||
var _len, | ||
args, | ||
_key, | ||
_args4 = arguments; | ||
return _regenerator["default"].wrap(function _callee4$(_context4) { | ||
while (1) { | ||
switch (_context4.prev = _context4.next) { | ||
case 0: | ||
for (_len = _args4.length, args = new Array(_len), _key = 0; _key < _len; _key++) { | ||
args[_key] = _args4[_key]; | ||
} | ||
nextArgs = nextArgs ? getNextArgs(nextArgs, args) : args; | ||
if (nextArgs) { | ||
_context4.next = 4; | ||
break; | ||
} | ||
throw new Error('unexpected error: nextArgs is null'); | ||
case 4: | ||
if (!nextInvocation) { | ||
_context4.next = 6; | ||
break; | ||
} | ||
return _context4.abrupt("return", nextInvocation); | ||
case 6: | ||
return _context4.abrupt("return", nextInvocation = (delay || Promise.resolve()).then(invoke)); | ||
case 7: | ||
case "end": | ||
return _context4.stop(); | ||
} | ||
} | ||
}, _callee4); | ||
})); | ||
return _wrapper.apply(this, arguments); | ||
nextArgs = nextArgs ? getNextArgs(nextArgs, args) : args; | ||
if (!nextArgs) return Promise.reject(new Error('unexpected error: nextArgs is null')); | ||
if (nextInvocation) return nextInvocation; | ||
return nextInvocation = (delay || Promise.resolve()).then(invoke); | ||
} | ||
@@ -185,0 +147,0 @@ |
{ | ||
"name": "@jcoreio/async-throttle", | ||
"version": "1.4.4", | ||
"version": "1.4.5", | ||
"description": "throttle async and promise-returning functions. Other packages don't do it right.", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
25375
261