Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

asyncbox

Package Overview
Dependencies
Maintainers
1
Versions
36
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

asyncbox - npm Package Compare versions

Comparing version 2.5.2 to 2.5.3

301

build/lib/asyncbox.js

@@ -19,6 +19,4 @@ "use strict";

var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
require("source-map-support/register");
var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
var _bluebird = _interopRequireDefault(require("bluebird"));

@@ -30,88 +28,54 @@

function sleep(_x) {
return _sleep.apply(this, arguments);
async function sleep(ms) {
return await _bluebird.default.delay(ms);
}
function _sleep() {
_sleep = (0, _asyncToGenerator2.default)(function* (ms) {
return yield _bluebird.default.delay(ms);
});
return _sleep.apply(this, arguments);
}
async function retry(times, fn, ...args) {
let tries = 0;
let done = false;
let res = null;
function retry(_x2, _x3) {
return _retry.apply(this, arguments);
}
while (!done && tries < times) {
tries++;
function _retry() {
_retry = (0, _asyncToGenerator2.default)(function* (times, fn, ...args) {
let tries = 0;
let done = false;
let res = null;
while (!done && tries < times) {
tries++;
try {
res = yield fn(...args);
done = true;
} catch (err) {
if (tries >= times) {
throw err;
}
try {
res = await fn(...args);
done = true;
} catch (err) {
if (tries >= times) {
throw err;
}
}
}
return res;
});
return _retry.apply(this, arguments);
return res;
}
function retryInterval(_x4, _x5, _x6) {
return _retryInterval.apply(this, arguments);
}
async function retryInterval(times, sleepMs, fn, ...args) {
let count = 0;
function _retryInterval() {
_retryInterval = (0, _asyncToGenerator2.default)(function* (times, sleepMs, fn, ...args) {
let count = 0;
let wrapped = async () => {
count++;
let res;
let wrapped = function () {
var _ref = (0, _asyncToGenerator2.default)(function* () {
count++;
let res;
try {
res = await fn(...args);
} catch (e) {
if (count !== times) {
await sleep(sleepMs);
}
try {
res = yield fn(...args);
} catch (e) {
if (count !== times) {
yield sleep(sleepMs);
}
throw e;
}
throw e;
}
return res;
};
return res;
});
return function wrapped() {
return _ref.apply(this, arguments);
};
}();
return yield retry(times, wrapped);
});
return _retryInterval.apply(this, arguments);
return await retry(times, wrapped);
}
function parallel(_x7) {
return _parallel.apply(this, arguments);
async function parallel(promises) {
return await _bluebird.default.all(promises);
}
function _parallel() {
_parallel = (0, _asyncToGenerator2.default)(function* (promises) {
return yield _bluebird.default.all(promises);
});
return _parallel.apply(this, arguments);
}
function nodeify(promisey, cb) {

@@ -123,31 +87,9 @@ return _bluebird.default.resolve(promisey).nodeify(cb);

let cbMap = {};
var _iteratorNormalCompletion = true;
var _didIteratorError = false;
var _iteratorError = undefined;
try {
for (var _iterator = (0, _es6Mapify.mapify)(promiseyMap)[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {
let _step$value = (0, _slicedToArray2.default)(_step.value, 2),
name = _step$value[0],
fn = _step$value[1];
cbMap[name] = function (...args) {
let _cb = args.slice(-1)[0];
args = args.slice(0, -1);
nodeify(fn(...args), _cb);
};
}
} catch (err) {
_didIteratorError = true;
_iteratorError = err;
} finally {
try {
if (!_iteratorNormalCompletion && _iterator.return != null) {
_iterator.return();
}
} finally {
if (_didIteratorError) {
throw _iteratorError;
}
}
for (const [name, fn] of (0, _es6Mapify.mapify)(promiseyMap)) {
cbMap[name] = function (...args) {
const _cb = args.slice(-1)[0];
args = args.slice(0, -1);
nodeify(fn(...args), _cb);
};
}

@@ -162,138 +104,71 @@

function asyncmap(_x8, _x9) {
return _asyncmap.apply(this, arguments);
}
async function asyncmap(coll, mapper, runInParallel = true) {
if (runInParallel) {
return parallel(coll.map(mapper));
}
function _asyncmap() {
_asyncmap = (0, _asyncToGenerator2.default)(function* (coll, mapper, runInParallel = true) {
if (runInParallel) {
return parallel(coll.map(mapper));
}
let newColl = [];
let newColl = [];
var _iteratorNormalCompletion2 = true;
var _didIteratorError2 = false;
var _iteratorError2 = undefined;
for (let item of coll) {
newColl.push((await mapper(item)));
}
try {
for (var _iterator2 = coll[Symbol.iterator](), _step2; !(_iteratorNormalCompletion2 = (_step2 = _iterator2.next()).done); _iteratorNormalCompletion2 = true) {
let item = _step2.value;
newColl.push((yield mapper(item)));
}
} catch (err) {
_didIteratorError2 = true;
_iteratorError2 = err;
} finally {
try {
if (!_iteratorNormalCompletion2 && _iterator2.return != null) {
_iterator2.return();
}
} finally {
if (_didIteratorError2) {
throw _iteratorError2;
}
}
}
return newColl;
});
return _asyncmap.apply(this, arguments);
return newColl;
}
function asyncfilter(_x10, _x11) {
return _asyncfilter.apply(this, arguments);
}
async function asyncfilter(coll, filter, runInParallel = true) {
let newColl = [];
function _asyncfilter() {
_asyncfilter = (0, _asyncToGenerator2.default)(function* (coll, filter, runInParallel = true) {
let newColl = [];
if (runInParallel) {
let bools = await parallel(coll.map(filter));
if (runInParallel) {
let bools = yield parallel(coll.map(filter));
for (let i = 0; i < coll.length; i++) {
if (bools[i]) {
newColl.push(coll[i]);
}
for (let i = 0; i < coll.length; i++) {
if (bools[i]) {
newColl.push(coll[i]);
}
} else {
var _iteratorNormalCompletion3 = true;
var _didIteratorError3 = false;
var _iteratorError3 = undefined;
try {
for (var _iterator3 = coll[Symbol.iterator](), _step3; !(_iteratorNormalCompletion3 = (_step3 = _iterator3.next()).done); _iteratorNormalCompletion3 = true) {
let item = _step3.value;
if (yield filter(item)) {
newColl.push(item);
}
}
} catch (err) {
_didIteratorError3 = true;
_iteratorError3 = err;
} finally {
try {
if (!_iteratorNormalCompletion3 && _iterator3.return != null) {
_iterator3.return();
}
} finally {
if (_didIteratorError3) {
throw _iteratorError3;
}
}
}
} else {
for (let item of coll) {
if (await filter(item)) {
newColl.push(item);
}
}
}
return newColl;
});
return _asyncfilter.apply(this, arguments);
return newColl;
}
function waitForCondition(_x12) {
return _waitForCondition.apply(this, arguments);
}
async function waitForCondition(condFn, opts = {}) {
_lodash.default.defaults(opts, {
waitMs: 5000,
intervalMs: 500
});
function _waitForCondition() {
_waitForCondition = (0, _asyncToGenerator2.default)(function* (condFn, opts = {}) {
_lodash.default.defaults(opts, {
waitMs: 5000,
intervalMs: 500
});
let debug = opts.logger ? opts.logger.debug.bind(opts.logger) : _lodash.default.noop;
let begunAt = Date.now();
let endAt = begunAt + opts.waitMs;
let debug = opts.logger ? opts.logger.debug.bind(opts.logger) : _lodash.default.noop;
let begunAt = Date.now();
let endAt = begunAt + opts.waitMs;
let spin = async () => {
const result = await condFn();
let spin = function () {
var _ref2 = (0, _asyncToGenerator2.default)(function* () {
const result = yield condFn();
if (result) {
return result;
}
if (result) {
return result;
}
let now = Date.now();
let waited = now - begunAt;
let now = Date.now();
let waited = now - begunAt;
if (now < endAt) {
debug(`Waited for ${waited} ms so far`);
await _bluebird.default.delay(opts.intervalMs);
return await spin();
}
if (now < endAt) {
debug(`Waited for ${waited} ms so far`);
yield _bluebird.default.delay(opts.intervalMs);
return yield spin();
}
throw new Error(`Condition unmet after ${waited} ms. Timing out.`);
};
throw new Error(`Condition unmet after ${waited} ms. Timing out.`);
});
return function spin() {
return _ref2.apply(this, arguments);
};
}();
return yield spin();
});
return _waitForCondition.apply(this, arguments);
return await spin();
}require('source-map-support').install();
//# sourceMappingURL=data:application/json;charset=utf8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImxpYi9hc3luY2JveC5qcyJdLCJuYW1lcyI6WyJzbGVlcCIsIm1zIiwiQiIsImRlbGF5IiwicmV0cnkiLCJ0aW1lcyIsImZuIiwiYXJncyIsInRyaWVzIiwiZG9uZSIsInJlcyIsImVyciIsInJldHJ5SW50ZXJ2YWwiLCJzbGVlcE1zIiwiY291bnQiLCJ3cmFwcGVkIiwiZSIsInBhcmFsbGVsIiwicHJvbWlzZXMiLCJhbGwiLCJub2RlaWZ5IiwicHJvbWlzZXkiLCJjYiIsInJlc29sdmUiLCJub2RlaWZ5QWxsIiwicHJvbWlzZXlNYXAiLCJjYk1hcCIsIm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sIHJldHJ5SW50ZXJ2YWwsIGFzeW5jaWZ5LCBwYXJhbGxlbCxcbiAgYXN5bmNtYXAsIGFzeW5jZmlsdGVyLCB3YWl0Rm9yQ29uZGl0aW9uXG59O1xuIl0sImZpbGUiOiJsaWIvYXN5bmNib3guanMiLCJzb3VyY2VSb290IjoiLi4vLi4ifQ==

@@ -58,6 +58,5 @@ // transpile:main

let cbMap = {};
for (let [name, fn] of mapify(promiseyMap)) {
/*jshint -W083 */
for (const [name, fn] of mapify(promiseyMap)) {
cbMap[name] = function (...args) {
let _cb = args.slice(-1)[0];
const _cb = args.slice(-1)[0];
args = args.slice(0, -1);

@@ -64,0 +63,0 @@ nodeify(fn(...args), _cb);

@@ -9,3 +9,3 @@ {

],
"version": "2.5.2",
"version": "2.5.3",
"author": "jlipps@gmail.com",

@@ -50,11 +50,6 @@ "license": "Apache-2.0",

"ajv": "^6.5.3",
"appium-gulp-plugins": "^3.0.0",
"babel-eslint": "^10.0.0",
"appium-gulp-plugins": "^4.0.0",
"chai": "4.2.0",
"chai-as-promised": "^7.1.1",
"eslint": "^5.2.0",
"eslint-config-appium": "^3.1.0",
"eslint-plugin-import": "^2.2.0",
"eslint-plugin-mocha": "^5.0.0",
"eslint-plugin-promise": "^4.0.0",
"eslint-config-appium": "^4.0.0",
"gulp": "^4.0.0",

@@ -61,0 +56,0 @@ "request": "^2.47.0",

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc