json-logic-engine icon indicating copy to clipboard operation
json-logic-engine copied to clipboard

Can't get json-logic-engine to work with this logic

Open boozedog opened this issue 1 year ago • 3 comments

Hi there! I am evaluating json-logic-engine and I am finding that the following logic compiles but crashes at runtime. Same rule/data works in json-logic-js.

Logic:

{
    "map": [
        {
            "var": ""
        },
        {
            "*": {
                "cat": [
                    {
                        "var": "a"
                    },
                    " ",
                    {
                        "var": "b"
                    }
                ]
            }
        }
    ]
}

Data:

[
    {
        "a": "foo",
        "b": "bar"
    },
    {
        "a": "fizz",
        "b": "buzz"
    }
]

Error:

Uncaught TypeError: ("" + ((intermediate value) ?? null) + " " + ((intermediate value) ?? null)).reduce is not a function

boozedog avatar Nov 10 '23 16:11 boozedog