[Pkg-javascript-commits] [node-jsonstream] 113/214: filter by returning null from filter/map

Bastien Roucariès rouca at moszumanska.debian.org
Fri Dec 1 12:58:47 UTC 2017


This is an automated email from the git hooks/post-receive script.

rouca pushed a commit to branch master
in repository node-jsonstream.

commit 5edb153e855df3a592f5ef33d647420ce0071577
Author: Dominic Tarr <dominic.tarr at gmail.com>
Date:   Tue May 13 15:48:29 2014 +0200

    filter by returning null from filter/map
---
 index.js | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/index.js b/index.js
index db6d97d..5431db2 100755
--- a/index.js
+++ b/index.js
@@ -84,7 +84,8 @@ exports.parse = function (path, map) {
     count ++
     var data = this.value[this.key]
     if(null != data)
-      stream.queue(map ? map(data) : data)
+      if(null != (data = map ? map(data) : data))
+        stream.queue(data)
     delete this.value[this.key]
   }
   parser._onToken = parser.onToken;

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-javascript/node-jsonstream.git



More information about the Pkg-javascript-commits mailing list