Comparing version 4.1.0 to 4.2.0
4.2.0 / 2015-01-20 | ||
================== | ||
* support comparing generator functions with ES6 transpilers | ||
4.1.0 / 2014-12-26 | ||
@@ -6,3 +11,3 @@ ================== | ||
* fix memory leak #180 | ||
4.0.2 / 2014-12-18 | ||
@@ -9,0 +14,0 @@ ================== |
12
index.js
@@ -216,7 +216,15 @@ | ||
function isGeneratorFunction(obj) { | ||
var constructor = obj.constructor; | ||
return constructor && 'GeneratorFunction' == constructor.name; | ||
return obj && obj.constructor == generator.constructor; | ||
} | ||
/** | ||
* Empty generator function for constructor comparison. | ||
* This allows comparisons to work with ES6 transpilers. | ||
* | ||
* @api private | ||
*/ | ||
function* generator() {} | ||
/** | ||
* Check for plain object. | ||
@@ -223,0 +231,0 @@ * |
{ | ||
"name": "co", | ||
"version": "4.1.0", | ||
"version": "4.2.0", | ||
"description": "generator async control flow goodness", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
@@ -14,6 +14,6 @@ # co | ||
`co@4.0.0` has been released, which relies promises. | ||
It is now a stepping stone towards [ES7 async/await](https://github.com/lukehoban/ecmascript-asyncawait). | ||
`co@4.0.0` has been released, which now relies on promises. | ||
It is a stepping stone towards [ES7 async/await](https://github.com/lukehoban/ecmascript-asyncawait). | ||
The primary API change is how `co()` is invoked. | ||
Before, `co` returned a "thunk", which you then call with a callback with optional arguments. | ||
Before, `co` returned a "thunk", which you then called with a callback and optional arguments. | ||
Now, `co()` returns a promise. | ||
@@ -20,0 +20,0 @@ |
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
15077
205
0