Perhaps a better request would be to reduce the number of items in the list and add a negation option.
e.g. instead of is empty and is not empty we have only is empty and a not choice
Of course this would be a breaking change
As for testing isNaN - thats a reasonable suggestion
A not option is my preferred solution but that requires a substantial change and a bit of work in handling the transition for existing nodes to a new format with an extra option.
The upgrade path HAS to be as faultless as possible
We already have the requirement to allow for compound rules - tests against multiple properties with AND/OR conditions. That will drive a much larger underlying change to the node properties.
Modifying the list of available options will be trivial in comparison.
Whether we end up with a list of all is FOO and is not FOO, or simplify the list to just is FOO and then a not modifier than can be applied is something to consider as part of the UI rework needed. The downside is discoverability - knowing to select the is FOO option and then being able to negate it.
The current approach of adding two rules - is FOO then otherwise is a workaround that leaves you with unused ports on the node that you have to remember to ignore.
If some code has parsed a string to a number, it could create the value NaN. The requirement is to detect that case. You cannot use is type because typeof NaNisnumber.
ah right.. so surely the fix would be to fix our "is of type" number test to report that as false - so it is as normal humans would expect (rather than Javascript programmers). ?
True - the question is then, is there a not completely artificial use case for wanting to know you have NaN specifically, rather than it not being a number value?
I can't think of a time when I've ever wanted to know I have NaN, rather than know I don't have a number.
If we have NaN in the UI, then we have to explain to users what that means. And frankly, I doubt that is worth the effort or needed at all.
Also are there any use cases for the inverse - wanting to allow NaN through as it is (correctly) of type Numeric.
There is also the case of INFINITY to consider.
I am nervous about making a breaking change to the Switch node where, if anyone does have a flow that will be broken, the only solution is to use a Function node.
Its up to devs whether to have the ease of programming new behaviour but it be a breaking change or go to the trouble of making sure it doesn't break existing flows
No - they'd just have to redo their switch node - the new node would be a superset of the old one
Okay - so with your low-code/no-code evangelist hat on, what is the scenario where you need to know you have NaN?
There are some ugly bits of the JavaScript language and we shouldn't just blindly require end users to understand them. We don't always get it right, but we do give it some proper consideration.