New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

object-streaming-tools

Package Overview
Dependencies
Maintainers
1
Versions
13
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

object-streaming-tools - npm Package Compare versions

Comparing version 1.0.5 to 1.1.0

lib/switchBy.js

2

.eslintrc.json

@@ -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
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