Skip to content
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

Treat null as undefined in match method of SCIMMY.Types.Filter class #36

Merged
merged 4 commits into from
Jul 24, 2024

Conversation

sleelin
Copy link
Collaborator

@sleelin sleelin commented Jul 24, 2024

Currently, when a filter is instantiated with an expression that looks for equality of "empty" values (e.g. value eq null), the match method will strictly compare against the value null. This comparison will always fail, as null is treated as undefined in attribute coercion.

The match method has been updated to treat null as undefined for equality comparison purposes (fixes #34). Additionally, the internal tokenise method has been updated to correctly detect unescaped string values that begin with numbers. The test fixtures for the filter class have also been updated to verify the expected behaviour as above.

sleelin added 4 commits July 24, 2024 17:08
…escaped string values

Specifically, when the word token follows a comparator token. Ideally, this shouldn't be needed as strings would be properly wrapped.
…e to boolean

Only cast from string to boolean when comparing for equality, and when actual value is also a boolean.
@sleelin sleelin added the bug Something isn't working label Jul 24, 2024
@sleelin sleelin added this to the 1.2.3 milestone Jul 24, 2024
@sleelin sleelin self-assigned this Jul 24, 2024
@sleelin sleelin merged commit 2efaec8 into main Jul 24, 2024
2 checks passed
@sleelin sleelin deleted the issue/34-filter-null-value branch July 24, 2024 08:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
1 participant