throws error " + 123 : operation invalid for one or more operands types".
Error can be fixed by this change to fn-generator.js:
-const presence = (...args) => args.reduce((acc, arg) => acc && (arg || arg===0), true);
+const presence = (...args) => args.reduce((acc, arg) => acc && (arg!=undefined), true);
As far as I understand, the main purpose of this function is to determine the presence of the necessary parameters. But with such implementation, only numeric values can be empty. Comparison with undefined solves the problem for other types.
Rule: 'a+b' context: {a:"", b"123"}
throws error " + 123 : operation invalid for one or more operands types".
Error can be fixed by this change to fn-generator.js: -const presence = (...args) => args.reduce((acc, arg) => acc && (arg || arg===0), true); +const presence = (...args) => args.reduce((acc, arg) => acc && (arg!=undefined), true);
As far as I understand, the main purpose of this function is to determine the presence of the necessary parameters. But with such implementation, only numeric values can be empty. Comparison with undefined solves the problem for other types.