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

Support select ... where foo = true #592

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

ithinkihaveacat
Copy link

That is, filtering by the boolean value true, rather than the string 'true'.

i.e. filtering by the boolean value true, rather than the string 'true'
@@ -96,14 +105,14 @@ function _iterate(resource, statement, context, source, keep) {
for(var v in result) {
if(_.isArray(expected[j])) {
for(var vv in expected[j]) {
if(result[v] == expected[j][vv]) {
if(result[v] === expected[j][vv]) {
Copy link
Author

Choose a reason for hiding this comment

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

This change is necessary to prevent the boolean true matching 0, etc. This does, however, mean that queries that previously relied upon '' matching 0 will break, but arguably it was a bug that they matched in the first place...

The alternative is to check whether the expected value is a boolean, and only doing the stricter === check if so.

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