Skip to content

Conversation

@TotalTechGeek
Copy link
Member

@TotalTechGeek TotalTechGeek commented May 23, 2024

Resolved an issue with the built-in unary operators, where they did not account for whether the parameter was an array or not.

A note: There is still some incompatibility with if statements that do not have the required # of arguments.

Like these -

[
        {
            "if": []
        },
        null,
        null
    ],
    [
        {
            "if": [
                true
            ]
        },
        null,
        true
    ],
    [
        {
            "if": [
                false
            ]
        },
        null,
        false
    ],
    [
        {
            "if": [
                "apple"
            ]
        },
        null,
        "apple"
    ]

I'm not sure at this point in time if I agree with the original implementation that this should be the desired behavior. I'd really rather throw an exception for this. Maybe I could introduce a strict mode that has my preferences? Or allow permissive mode to behave like the original lib?

@TotalTechGeek
Copy link
Member Author

This should fix issue #31

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant