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

Adds NOT and XOR triggers for conditions #2816

Merged
merged 2 commits into from
Mar 30, 2020
Merged

Conversation

shefalijoshi
Copy link
Contributor

Resolves #2811

Author Checklist

  • Changes address original issue? Yes
  • Unit tests included and/or updated with changes? Yes
  • Command line build passes? Yes
  • Changes have been smoke-tested? Yes

Copy link
Contributor

@charlesh88 charlesh88 left a comment

Choose a reason for hiding this comment

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

Pulled this down locally and I've got nothing to add - good to go.

Copy link
Contributor

@akhenry akhenry left a comment

Choose a reason for hiding this comment

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

@Shefali looks great, two tiny changes that I will file followups for.

let trueCount = 0;
for (let key in resultMap) {
if (resultMap.hasOwnProperty(key)) {
if (resultMap[key]) {
Copy link
Contributor

Choose a reason for hiding this comment

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

I think that generally speaking just checking for "truthiness" is a bit vague and can lead to subtle bugs. I'd prefer to be explicit here and check if (resultMap[key]) === true or if (resultMap[key]) !== undefined - whatever the intended behavior is here.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done.

'any': 'when any criteria are met',
'all': 'when all criteria are met',
'not': 'when no criteria are met',
'xor': 'when only one criteria is met'
Copy link
Contributor

Choose a reason for hiding this comment

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

Being pedantic, but it should be criterion singular (as we correctly have it elsewhere in our code).

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done.

@akhenry akhenry mentioned this pull request Mar 30, 2020
13 tasks
@akhenry
Copy link
Contributor

akhenry commented Mar 30, 2020

Reviewer Checklist

  • Changes appear to address issue? Y
  • Appropriate unit tests included? Y
  • Code style and in-line documentation are appropriate? Y
  • Commit messages meet standards? Y

@akhenry akhenry merged commit a31d10e into topic-conditionals Mar 30, 2020
@shefalijoshi shefalijoshi deleted the xor-not-match branch September 3, 2020 17:29
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.

3 participants