thunkify-wrap
Advanced tools
Comparing version 0.0.5 to 0.1.0
0.1.0 / 2014-03-17 | ||
================== | ||
* fix event | ||
0.0.5 / 2014-03-06 | ||
@@ -3,0 +8,0 @@ ================== |
@@ -26,6 +26,2 @@ /**! | ||
if (input instanceof EventEmitter) { | ||
return eventToThunk(input, ctx); | ||
} | ||
// thunkify object | ||
@@ -105,3 +101,3 @@ if (type === 'object') { | ||
*/ | ||
function eventToThunk(e, globalEvents) { | ||
module.exports.event = function (e, globalEvents) { | ||
globalEvents = globalEvents || ['end']; | ||
@@ -146,2 +142,2 @@ return function (endEvents) { | ||
}; | ||
} | ||
}; |
{ | ||
"name": "thunkify-wrap", | ||
"version": "0.0.5", | ||
"version": "0.1.0", | ||
"repository": "dead-horse/node-thunkify-wrap", | ||
@@ -5,0 +5,0 @@ "description": "Turn callbacks, arrays, generators, generator functions, and promises into a thunk", |
@@ -41,3 +41,3 @@ | ||
var e = new EventEmitter(); | ||
var end = thunkify(e, 'finish'); | ||
var end = thunkify.event(e, 'finish'); | ||
@@ -44,0 +44,0 @@ yield end(); |
@@ -6,6 +6,6 @@ | ||
describe('thunkify(event)', function () { | ||
describe('thunkify.event(event)', function () { | ||
it('should ok by globalEvents', function (done) { | ||
var e = new EventEmitter(); | ||
var end = thunkify(e, 'finish'); | ||
var end = thunkify.event(e, 'finish'); | ||
e.on('data', function (data) { | ||
@@ -25,3 +25,3 @@ assert(data.foo === 'bar'); | ||
var e = new EventEmitter(); | ||
var end = thunkify(e, 'finish'); | ||
var end = thunkify.event(e, 'finish'); | ||
e.on('data', function (data) { | ||
@@ -41,3 +41,3 @@ assert(data.foo === 'bar'); | ||
var e = new EventEmitter(); | ||
var end = thunkify(e, 'finish'); | ||
var end = thunkify.event(e, 'finish'); | ||
e.on('data', function (data) { | ||
@@ -58,3 +58,3 @@ assert(data.foo === 'bar'); | ||
var e = new EventEmitter(); | ||
var end = thunkify(e, 'finish'); | ||
var end = thunkify.event(e, 'finish'); | ||
e.on('data', function (data) { | ||
@@ -61,0 +61,0 @@ assert(data.foo === 'bar'); |
@@ -12,3 +12,2 @@ | ||
thunkify(read); | ||
console.log(read.async.toString()); | ||
}); | ||
@@ -15,0 +14,0 @@ |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
13711
392