Closed eduardolundgren closed 10 years ago
Actually, I think I was incorrect. gulp-if thinks trueStream and falseStream are streams, not functions. Intriguing use-case.
Accepting a function looks non-invasive way to handle that. It could be interpreted as a new use case for gulp-if to be able to accept functions, or in other words ability to dynamic create a stream, e.g:
if('*.js', function() { return trueStream; }, function() { return falseStream; })
Looking at this further, it appears the bug wasn't in gulp-if, but was actually in lazypipe. Does the solution in https://github.com/robrich/gulp-if/issues/32 work for you? If so, it seems a more discoverable way to resolve this than teaching gulp-if how to use things that aren't streams.
documented at https://github.com/robrich/gulp-if#works-great-inside-lazypipe and https://github.com/OverZealous/lazypipe/pull/9. Thanks for your work documenting this issue.
If the trueChild or falseChild is a function, you want them to get passed the vinyl-fs object and make a choice about each file as it passes through.