Comparing version 0.1.1 to 0.2.0
{ | ||
"name": "zig", | ||
"version": "0.1.1", | ||
"version": "0.2.0", | ||
"description": "Simple, but naughty, control flow for Node.js.", | ||
@@ -25,4 +25,4 @@ "main": "zig.js", | ||
"dependencies": { | ||
"lodash": "~2.4.1" | ||
"lodash": "4" | ||
} | ||
} |
@@ -116,3 +116,3 @@ "use strict"; | ||
done(null,1) | ||
},10) | ||
},12) | ||
}) | ||
@@ -119,0 +119,0 @@ .run(function(data,done){ |
16
zig.js
@@ -34,3 +34,3 @@ /* Copyright (c) 2014-2015 Richard Rodger, MIT License */ | ||
var ifdepth = 0, active = true | ||
var collect = 0, collector = [] | ||
var collect = 0, collected = 0, collector = [] | ||
var to | ||
@@ -65,8 +65,11 @@ | ||
nextstep() | ||
} | ||
} | ||
else if( 'run' == step.type && active ) { | ||
var pos = collect | ||
collect++ | ||
collector.push(null) | ||
step.fn(data,function(err,out){ | ||
if( err ) return errhandler(err); | ||
collector.push(out) | ||
collected++ | ||
collector[pos] = out | ||
check_collect() | ||
@@ -105,5 +108,6 @@ }) | ||
if( dead ) return; | ||
if( collector.length >= collect ) { | ||
if( collected >= collect ) { | ||
data = _.clone(collector) | ||
collect = 0 | ||
collected = 0 | ||
collector = [] | ||
@@ -131,3 +135,3 @@ wait_fn() | ||
function evalif(data,cond) { | ||
@@ -161,3 +165,3 @@ var bool = false | ||
} | ||
self.wait = function( fn ) { | ||
@@ -164,0 +168,0 @@ steps.push({ |
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
1214
393585
23
+ Addedlodash@4.17.21(transitive)
- Removedlodash@2.4.2(transitive)
Updatedlodash@4