mirror of
https://github.com/azure/login.git
synced 2026-06-06 13:47:07 +00:00
* Bump lodash from 4.17.15 to 4.17.19 (#52) Bumps [lodash](https://github.com/lodash/lodash) from 4.17.15 to 4.17.19. - [Release notes](https://github.com/lodash/lodash/releases) - [Commits](https://github.com/lodash/lodash/compare/4.17.15...4.17.19) Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Amruta Kawade <65217380+AmrutaKawade@users.noreply.github.com> * Bump @actions/core from 1.1.3 to 1.2.6 (#60) Bumps [@actions/core](https://github.com/actions/toolkit/tree/HEAD/packages/core) from 1.1.3 to 1.2.6. - [Release notes](https://github.com/actions/toolkit/releases) - [Changelog](https://github.com/actions/toolkit/blob/main/packages/core/RELEASES.md) - [Commits](https://github.com/actions/toolkit/commits/HEAD/packages/core) Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Amruta Kawade <65217380+AmrutaKawade@users.noreply.github.com> * updating node_nodules * updated package-lock Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
81 lines
No EOL
1.5 KiB
JavaScript
81 lines
No EOL
1.5 KiB
JavaScript
"use strict";
|
|
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
exports["default"] = parallel;
|
|
|
|
var _AsynccError = _interopRequireDefault(require("./AsynccError"));
|
|
|
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
|
|
function parallel(limit, length, run) {
|
|
var opts = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};
|
|
var callback = arguments.length > 4 ? arguments[4] : undefined;
|
|
|
|
if (typeof opts === 'function') {
|
|
callback = opts;
|
|
opts = {};
|
|
}
|
|
|
|
limit = Math.abs(limit || length);
|
|
var errpos = [];
|
|
var errors = new Array(length).fill();
|
|
var results = new Array(length).fill();
|
|
var i = 0;
|
|
var l = length;
|
|
var done = 0;
|
|
|
|
if (l === 0) {
|
|
_final();
|
|
|
|
return;
|
|
}
|
|
|
|
if (opts.timeout) {
|
|
setTimeout(function () {
|
|
/* istanbul ignore else */
|
|
if (l) _final('err_timeout');
|
|
}, opts.timeout);
|
|
}
|
|
|
|
limit = limit < length ? limit : length;
|
|
|
|
while (i < limit) {
|
|
run(i++, cb);
|
|
}
|
|
|
|
function _final(errMsg) {
|
|
if (done++) return;
|
|
var err = null;
|
|
|
|
if (errpos.length || errMsg) {
|
|
err = new _AsynccError["default"](errMsg || 'err', errors, errpos);
|
|
}
|
|
|
|
callback && callback(err, results);
|
|
}
|
|
|
|
function cb(j, err, res) {
|
|
results[j] = res;
|
|
errors[j] = err;
|
|
|
|
if (err) {
|
|
errpos.push(j);
|
|
|
|
if (opts.bail) {
|
|
_final('err_bail');
|
|
|
|
return;
|
|
}
|
|
}
|
|
|
|
l--;
|
|
|
|
if (i < length) {
|
|
run(i++, cb);
|
|
} else if (!l) {
|
|
_final();
|
|
}
|
|
}
|
|
} |