-
-
Save Raynos/fa934f471a8a895cd565 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// filter := ((Value) => Boolean) => source:Stream => Stream | |
function filter(lambda) { return function (source) { | |
return source.pipe(through(function write(chunk) { | |
if (lambda(chunk)) { | |
this.push(chunk) | |
} | |
})) | |
} } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment