Skip to content

Resolve an issue with the unary operators. #32

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
May 23, 2024

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

@TotalTechGeek TotalTechGeek merged commit afdeb79 into master May 23, 2024
3 checks passed
@TotalTechGeek TotalTechGeek deleted the bugfix/resolve-issue-31 branch July 4, 2024 19:54
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