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.0.4 to 2.1.0

193

build/lib/asyncbox.js

@@ -325,2 +325,191 @@ 'use strict';

function asyncmap(coll, mapper) {
var runInParallel = arguments[2] === undefined ? true : arguments[2];
var newColl, _iteratorNormalCompletion3, _didIteratorError3, _iteratorError3, _iterator3, _step3, item;
return _regeneratorRuntime.async(function asyncmap$(context$1$0) {
while (1) switch (context$1$0.prev = context$1$0.next) {
case 0:
if (!runInParallel) {
context$1$0.next = 2;
break;
}
return context$1$0.abrupt('return', parallel(coll.map(mapper)));
case 2:
newColl = [];
_iteratorNormalCompletion3 = true;
_didIteratorError3 = false;
_iteratorError3 = undefined;
context$1$0.prev = 6;
_iterator3 = _getIterator(coll);
case 8:
if (_iteratorNormalCompletion3 = (_step3 = _iterator3.next()).done) {
context$1$0.next = 17;
break;
}
item = _step3.value;
context$1$0.next = 12;
return _regeneratorRuntime.awrap(mapper(item));
case 12:
context$1$0.t0 = context$1$0.sent;
newColl.push(context$1$0.t0);
case 14:
_iteratorNormalCompletion3 = true;
context$1$0.next = 8;
break;
case 17:
context$1$0.next = 23;
break;
case 19:
context$1$0.prev = 19;
context$1$0.t1 = context$1$0['catch'](6);
_didIteratorError3 = true;
_iteratorError3 = context$1$0.t1;
case 23:
context$1$0.prev = 23;
context$1$0.prev = 24;
if (!_iteratorNormalCompletion3 && _iterator3['return']) {
_iterator3['return']();
}
case 26:
context$1$0.prev = 26;
if (!_didIteratorError3) {
context$1$0.next = 29;
break;
}
throw _iteratorError3;
case 29:
return context$1$0.finish(26);
case 30:
return context$1$0.finish(23);
case 31:
return context$1$0.abrupt('return', newColl);
case 32:
case 'end':
return context$1$0.stop();
}
}, null, this, [[6, 19, 23, 31], [24,, 26, 30]]);
}
function asyncfilter(coll, filter) {
var runInParallel = arguments[2] === undefined ? true : arguments[2];
var newColl, bools, i, _iteratorNormalCompletion4, _didIteratorError4, _iteratorError4, _iterator4, _step4, item;
return _regeneratorRuntime.async(function asyncfilter$(context$1$0) {
while (1) switch (context$1$0.prev = context$1$0.next) {
case 0:
newColl = [];
if (!runInParallel) {
context$1$0.next = 8;
break;
}
context$1$0.next = 4;
return _regeneratorRuntime.awrap(parallel(coll.map(filter)));
case 4:
bools = context$1$0.sent;
for (i = 0; i < coll.length; i++) {
if (bools[i]) {
newColl.push(coll[i]);
}
}
context$1$0.next = 36;
break;
case 8:
_iteratorNormalCompletion4 = true;
_didIteratorError4 = false;
_iteratorError4 = undefined;
context$1$0.prev = 11;
_iterator4 = _getIterator(coll);
case 13:
if (_iteratorNormalCompletion4 = (_step4 = _iterator4.next()).done) {
context$1$0.next = 22;
break;
}
item = _step4.value;
context$1$0.next = 17;
return _regeneratorRuntime.awrap(filter(item));
case 17:
if (!context$1$0.sent) {
context$1$0.next = 19;
break;
}
newColl.push(item);
case 19:
_iteratorNormalCompletion4 = true;
context$1$0.next = 13;
break;
case 22:
context$1$0.next = 28;
break;
case 24:
context$1$0.prev = 24;
context$1$0.t0 = context$1$0['catch'](11);
_didIteratorError4 = true;
_iteratorError4 = context$1$0.t0;
case 28:
context$1$0.prev = 28;
context$1$0.prev = 29;
if (!_iteratorNormalCompletion4 && _iterator4['return']) {
_iterator4['return']();
}
case 31:
context$1$0.prev = 31;
if (!_didIteratorError4) {
context$1$0.next = 34;
break;
}
throw _iteratorError4;
case 34:
return context$1$0.finish(31);
case 35:
return context$1$0.finish(28);
case 36:
return context$1$0.abrupt('return', newColl);
case 37:
case 'end':
return context$1$0.stop();
}
}, null, this, [[11, 24, 28, 36], [29,, 31, 35]]);
}
exports.sleep = sleep;

@@ -333,4 +522,6 @@ exports.retry = retry;

exports.parallel = parallel;
exports.asyncmap = asyncmap;
exports.asyncfilter = asyncfilter;
/*jshint -W083 */
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WQgdHlwZXMgb2YgdGhpbmdzJywgYXN5bmMgKCkgPT4ge1xuICAgIGxldCBlcnI7XG4gICAgdHJ5IHtcbiAgICAgIGF3YWl0IHBhcmFsbGVsKFtdKTtcbiAgICB9IGNhdGNoIChlKSB7XG4gICAgICBlcnIgPSBlO1xuICAgIH1cbiAgICBzaG91bGQuZXhpc3QoZXJyKTtcbiAgICB0cnkge1xuICAgICAgYXdhaXQgcGFyYWxsZWwoJ2ZvbycpO1xuICAgIH0gY2F0Y2ggKGUpIHtcbiAgICAgIGVyciA9IGU7XG4gICAgfVxuICAgIHNob3VsZC5leGlzdChlcnIpO1xuICAgIHRyeSB7XG4gICAgICBhd2FpdCBwYXJhbGxlbChbMV0pO1xuICAgIH0gY2F0Y2ggKGUpIHtcbiAgICAgIGVyciA9IGU7XG4gICAgfVxuICAgIHNob3VsZC5leGlzdChlcnIpO1xuICB9KTtcbn0pO1xuIl19
describe('asyncmap', function () {
var mapper = function mapper(el) {
return _regeneratorRuntime.async(function mapper$(context$2$0) {
while (1) switch (context$2$0.prev = context$2$0.next) {
case 0:
context$2$0.next = 2;
return _regeneratorRuntime.awrap((0, _libAsyncbox.sleep)(5));
case 2:
return context$2$0.abrupt('return', el * 2);
case 3:
case 'end':
return context$2$0.stop();
}
}, null, this);
};
var coll = [1, 2, 3];
it('should map elements one at a time', function callee$1$0() {
var start;
return _regeneratorRuntime.async(function callee$1$0$(context$2$0) {
while (1) switch (context$2$0.prev = context$2$0.next) {
case 0:
start = Date.now();
context$2$0.next = 3;
return _regeneratorRuntime.awrap((0, _libAsyncbox.asyncmap)(coll, mapper, false));
case 3:
context$2$0.sent.should.eql([2, 4, 6]);
(Date.now() - start).should.be.above(11);
case 5:
case 'end':
return context$2$0.stop();
}
}, null, _this);
});
it('should map elements in parallel', function callee$1$0() {
var start;
return _regeneratorRuntime.async(function callee$1$0$(context$2$0) {
while (1) switch (context$2$0.prev = context$2$0.next) {
case 0:
start = Date.now();
context$2$0.next = 3;
return _regeneratorRuntime.awrap((0, _libAsyncbox.asyncmap)(coll, mapper));
case 3:
context$2$0.sent.should.eql([2, 4, 6]);
(Date.now() - start).should.be.below(9);
case 5:
case 'end':
return context$2$0.stop();
}
}, null, _this);
});
});
describe('asyncfilter', function () {
var filter = function filter(el) {
return _regeneratorRuntime.async(function filter$(context$2$0) {
while (1) switch (context$2$0.prev = context$2$0.next) {
case 0:
context$2$0.next = 2;
return _regeneratorRuntime.awrap((0, _libAsyncbox.sleep)(5));
case 2:
return context$2$0.abrupt('return', el % 2 === 0);
case 3:
case 'end':
return context$2$0.stop();
}
}, null, this);
};
var coll = [1, 2, 3, 4, 5];
it('should filter elements one at a time', function callee$1$0() {
var start;
return _regeneratorRuntime.async(function callee$1$0$(context$2$0) {
while (1) switch (context$2$0.prev = context$2$0.next) {
case 0:
start = Date.now();
context$2$0.next = 3;
return _regeneratorRuntime.awrap((0, _libAsyncbox.asyncfilter)(coll, filter, false));
case 3:
context$2$0.sent.should.eql([2, 4]);
(Date.now() - start).should.be.above(19);
case 5:
case 'end':
return context$2$0.stop();
}
}, null, _this);
});
it('should filter elements in parallel', function callee$1$0() {
var start;
return _regeneratorRuntime.async(function callee$1$0$(context$2$0) {
while (1) switch (context$2$0.prev = context$2$0.next) {
case 0:
start = Date.now();
context$2$0.next = 3;
return _regeneratorRuntime.awrap((0, _libAsyncbox.asyncfilter)(coll, filter));
case 3:
context$2$0.sent.should.eql([2, 4]);
(Date.now() - start).should.be.below(9);
case 5:
case 'end':
return context$2$0.stop();
}
}, null, _this);
});
});
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbInRlc3QvYXN5bmNib3gtc3BlY3MuanMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7Ozs7Ozs7OztRQUlPLFdBQVc7O3NCQUNDLFFBQVE7Ozs7MkJBRXFCLGlCQUFpQjs7QUFQakUsT0FBTyxDQUFDLG9CQUFvQixDQUFDLENBQUMsT0FBTyxF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NvbGwsIGZpbHRlciwgZmFsc2UpKS5zaG91bGQuZXFsKFsyLCA0XSk7XG4gICAgKERhdGUubm93KCkgLSBzdGFydCkuc2hvdWxkLmJlLmFib3ZlKDE5KTtcbiAgfSk7XG4gIGl0KCdzaG91bGQgZmlsdGVyIGVsZW1lbnRzIGluIHBhcmFsbGVsJywgYXN5bmMgKCkgPT4ge1xuICAgIGxldCBzdGFydCA9IERhdGUubm93KCk7XG4gICAgKGF3YWl0IGFzeW5jZmlsdGVyKGNvbGwsIGZpbHRlcikpLnNob3VsZC5lcWwoWzIsIDRdKTtcbiAgICAoRGF0ZS5ub3coKSAtIHN0YXJ0KS5zaG91bGQuYmUuYmVsb3coOSk7XG4gIH0pO1xufSk7XG4iXX0=

@@ -94,2 +94,34 @@ // transpile:main

export { sleep, retry, nodeify, nodeifyAll, retryInterval, asyncify, parallel };
async function asyncmap (coll, mapper, runInParallel = true) {
if (runInParallel) {
return parallel(coll.map(mapper));
}
let newColl = [];
for (let item of coll) {
newColl.push(await mapper(item));
}
return newColl;
}
async function asyncfilter (coll, filter, runInParallel = true) {
let newColl = [];
if (runInParallel) {
let bools = await parallel(coll.map(filter));
for (let i = 0; i < coll.length; i++) {
if (bools[i]) {
newColl.push(coll[i]);
}
}
} else {
for (let item of coll) {
if (await filter(item)) {
newColl.push(item);
}
}
}
return newColl;
}
export { sleep, retry, nodeify, nodeifyAll, retryInterval, asyncify, parallel,
asyncmap, asyncfilter };

2

package.json

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

],
"version": "2.0.4",
"version": "2.1.0",
"author": "jlipps@gmail.com",

@@ -12,0 +12,0 @@ "licenses": [

@@ -57,2 +57,27 @@ asyncbox

### Filter/Map
Filter and map are pretty handy concepts, and now you can write filter and map
functions that execute asynchronously!
```js
import { asyncmap, asyncfilter } from 'asyncbox';
```
Then in your async functions, you can do:
```js
const items = [1, 2, 3, 4];
const slowSquare = async (n) => { await sleep(5); return n * 2; };
let newItems = await asyncmap(items, async (i) => { return await slowSquare(i); });
console.log(newItems); // [1, 4, 9, 16];
const slowEven = async (n) => { await sleep(5); return n % 2 === 0; };
newItems = await asyncfilter(items, async (i) => { return await slowEven(i); });
console.log(newItems); // [2, 4];
```
By default, `asyncmap` and `asyncfilter` run their operations in parallel; you
can pass `false` as a third argument to make sure it happens serially.
### Nodeify

@@ -59,0 +84,0 @@

@@ -8,3 +8,3 @@ // transpile:mocha

import { sleep, retry, retryInterval, nodeify, nodeifyAll,
parallel } from '../lib/asyncbox';
parallel, asyncmap, asyncfilter } from '../lib/asyncbox';

@@ -245,1 +245,37 @@ describe('sleep', () => {

});
describe('asyncmap', () => {
const mapper = async function (el) {
await sleep(5);
return el * 2;
};
const coll = [1, 2, 3];
it('should map elements one at a time', async () => {
let start = Date.now();
(await asyncmap(coll, mapper, false)).should.eql([2, 4, 6]);
(Date.now() - start).should.be.above(11);
});
it('should map elements in parallel', async () => {
let start = Date.now();
(await asyncmap(coll, mapper)).should.eql([2, 4, 6]);
(Date.now() - start).should.be.below(9);
});
});
describe('asyncfilter', () => {
const filter = async function (el) {
await sleep(5);
return el % 2 === 0;
};
const coll = [1, 2, 3, 4, 5];
it('should filter elements one at a time', async () => {
let start = Date.now();
(await asyncfilter(coll, filter, false)).should.eql([2, 4]);
(Date.now() - start).should.be.above(19);
});
it('should filter elements in parallel', async () => {
let start = Date.now();
(await asyncfilter(coll, filter)).should.eql([2, 4]);
(Date.now() - start).should.be.below(9);
});
});

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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