From 1546cb3591a30522b220313d97189bfb0e16a26b Mon Sep 17 00:00:00 2001 From: akilan sengottaiyan Date: Wed, 24 Jan 2024 16:52:49 +0530 Subject: [PATCH] Use explicit condition to filter undefined and null instead of Boolean constructor Boolean constructor also filters out 0, empty string, empty array and empty object while all these are valid json logic expressions. --- lib/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/index.js b/lib/index.js index c6ab89c..ffe02fa 100644 --- a/lib/index.js +++ b/lib/index.js @@ -175,7 +175,7 @@ function processNode (node, valueOnly = false) { node.alternate ? processNode(node.alternate) : undefined - ].filter(Boolean) + ].filter(item => item !== undefined) } }