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

[mutator] Use strict equals when comparing equality #1326

Merged
merged 1 commit into from
May 23, 2019

Conversation

rexxars
Copy link
Member

@rexxars rexxars commented May 22, 2019

Given the object:
{attr: "123"}

The following expression matches in the mutators JSONPath implementation:
[attr==123]

While in the Sanity DB, it does not (should be [attr=="123"]).

The error was simply not using a strict equality check when evaluating the expression.
This PR fixes this and adds tests for this case.

Over-the-shoulder, IRL-approved by @simen

@rexxars rexxars requested review from simen and bjoerge May 22, 2019 12:30
@rexxars rexxars changed the title [mutator] Use triple equals when comparing equality [mutator] Use strict equals when comparing equality May 22, 2019
Copy link
Member

@bjoerge bjoerge left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💯from me!

@rexxars rexxars merged commit 82caf34 into next May 23, 2019
@rexxars rexxars deleted the fix-mutator-num-match branch May 23, 2019 11:14
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.

None yet

2 participants