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

chanel

Package Overview
Dependencies
Maintainers
1
Versions
10
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

chanel - npm Package Compare versions

Comparing version 2.0.0 to 2.0.1

5

lib/index.js
var co = require('co')
var describe = require('to-descriptor')

@@ -20,5 +19,5 @@

if (done === true) {
var thunk = co(read._flush())
var thunk = read._flush()
return arguments.length === 2
? thunk.call(read, arguments[1])
? thunk(arguments[1])
: thunk

@@ -25,0 +24,0 @@ }

43

lib/proto.js

@@ -204,11 +204,42 @@ var EventEmitter = require('events').EventEmitter

Channel.prototype._flush = function* () {
if (this.discard) {
while (this.readable) yield this
return
Channel.prototype._flush = function () {
if (this.discard) return this._flushDiscard.bind(this)
else return this._flushResults.bind(this)
}
Channel.prototype._flushDiscard = function (done) {
var read = this
if (!read.closed) {
read.pushed(function (err, pushed) {
if (!pushed) done()
else read(next)
})
} else {
read(next)
}
function next(err) {
if (err) done(err)
else if (!read.readable) done()
else read(next)
}
}
Channel.prototype._flushResults = function (done) {
var read = this
var results = []
while (this.readable) results.push(yield this)
return results
if (!read.closed) {
read.pushed(function (err, pushed) {
if (!pushed) done()
else read(next)
})
} else {
read(next)
}
function next(err, res) {
if (err) return done(err)
results.push(res)
if (read.readable) return read(next)
done(null, results)
}
}
{
"name": "chanel",
"version": "2.0.0",
"version": "2.0.1",
"description": "Channel-based control-flow for parallel tasks with concurrency control",

@@ -19,2 +19,3 @@ "repository": {

},
"main": "lib/index.js",
"dependencies": {

@@ -28,13 +29,8 @@ "generator-supported": "~0.0.1",

"should": "^3.0.0",
"regenerator": "*",
"gnode": "*"
},
"scripts": {
"test": "NODE=gnode make test",
"prepublish": "make clean build"
"test": "NODE=gnode make test"
},
"engines": {
"node": ">= 0.11.3"
},
"homepage": "https://github.com/cojs/chanel"
}

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