object-streaming-tools
Advanced tools
Comparing version 1.0.5 to 1.1.0
@@ -73,3 +73,3 @@ { | ||
"no-class-assign": "error", | ||
"no-confusing-arrow": [ "error", { "allowParens": false } ], | ||
"no-confusing-arrow": [ "error", { "allowParens": true } ], | ||
"no-useless-computed-key": "error", | ||
@@ -76,0 +76,0 @@ "no-useless-constructor": "error", |
@@ -6,10 +6,11 @@ /** | ||
* | ||
* @param { number } start | ||
* Integer to start from | ||
* @param {number} start | ||
* Integer to start from (inclusive) | ||
* | ||
* @param { number } end | ||
* Integer to end on | ||
* @param {number} end | ||
* Integer to end on (inclusive) | ||
* | ||
* @returns {object} | ||
* A stream that will emit each integer in the range, inclusive | ||
* A stream that will emit each integer in the range, | ||
* including start and end | ||
* | ||
@@ -16,0 +17,0 @@ */ |
{ | ||
"name": "object-streaming-tools", | ||
"version": "1.0.5", | ||
"version": "1.1.0", | ||
"description": "Helper functions to simplify creating and concatenating object streams in NodeJs", | ||
@@ -39,7 +39,6 @@ "main": "lib/index.js", | ||
"devDependencies": { | ||
"noisy-jasmine": "^1.0.1", | ||
"noisy-node-dev-tools": "^1.0.1" | ||
"noisy-jasmine": "^1.0.2" | ||
}, | ||
"dependencies": { | ||
"async": "^2.4.1", | ||
"async": "^2.5.0", | ||
"lodash": "^4.17.4" | ||
@@ -46,0 +45,0 @@ }, |
@@ -63,3 +63,3 @@ # Object Streaming Tools | ||
### iterate with spread (...) operator | ||
### iterate with the spread (...) operator | ||
@@ -96,2 +96,44 @@ ```JavaScript | ||
--- | ||
### get a range of numbers | ||
```JavaScript | ||
const range = require( 'object-streaming-tools/lib/range' ); | ||
range( 1, 3 ) | ||
.on( 'data', console.log ); | ||
// output: | ||
// 1 | ||
// 2 | ||
// 3 | ||
``` | ||
--- | ||
### switch things up | ||
```JavaScript | ||
const range = require( 'object-streaming-tools/lib/range' ); | ||
const switchBy = require( 'object-streaming-tools/lib/switchBy' ); | ||
const asyncify = require( 'async/asyncify' ); | ||
const lookup = [ 'one', 'three', 'five' ]; | ||
const forTrue = { ifMatches: true, thenDo: asyncify( x=>lookup[ x ] ) }; | ||
const forFalse = { ifMatches: false, thenDo: asyncify( x=>x ) }; | ||
range( 1, 5 ) | ||
.pipe( switchBy( asyncify( x=>!!x % 2 ), [ forTrue, forFalse ] ) ) | ||
.on( 'data', console.log ); | ||
// output: | ||
// one | ||
// 2 | ||
// three | ||
// 4 | ||
// five | ||
``` | ||
TBC |
Dynamic require
Supply chain riskDynamic require can indicate the package is performing dangerous or unsafe dynamic code execution.
Found 1 instance in 1 package
70726
1
44
2253
137
22
Updatedasync@^2.5.0