add check for NaN in is of type number to be false

and add test
to fix issue #3408
This commit is contained in:
Dave Conway-Jones
2022-02-09 12:03:38 +00:00
parent 5c87a6cb76
commit 63ebadc526
2 changed files with 7 additions and 0 deletions

View File

@@ -55,6 +55,7 @@ module.exports = function(RED) {
catch(e) { return false;}
}
else if (b === "null") { return a === null; }
else if (b === "number") { return typeof a === b && !isNaN(a) }
else { return typeof a === b && !Array.isArray(a) && !Buffer.isBuffer(a) && a !== null; }
},
'head': function(a, b, c, d, parts) {