-
Notifications
You must be signed in to change notification settings - Fork 15
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
Add has / !has operators #15
Conversation
👍 |
t.equal(f({properties: {foo: true}}), true); | ||
t.equal(f({properties: {foo: false}}), true); | ||
t.equal(f({properties: {foo: null}}), true); | ||
t.equal(f({properties: {foo: undefined}}), false); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd expect this to be true
.
This PR is blocked on a decision about how the Open questions:
|
Let's go with the definitions you've chosen:
We may add explicit |
👋 @lucaswoj - this is going to be super useful to find stats with https://github.com/mapbox/osm-tag-stats (mapbox/osm-tag-stats#2) . Will this get merged soon? |
@arunasank I'll get this into the next release! |
With humility and hindsight, I think @jfirebaugh's proposed definitions for |
} | ||
|
||
function compareDescending(a, b) { | ||
return a - b; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This doesn't work for strings.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed in latest commit
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How so? I still see a - b
which returns NaN
for strings.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
😞 It got lost in the rebase shuffle. 😄 Fixed now!
Ah, ok, I'm fine with that too. 😄 For those following along, the behavior in question is "should |
Cleaned up the commit history and addressed #15 (comment). Ready to 🚢? |
🚢 |
ref mapbox/mapbox-gl-style-spec#364
This will require a minor version bump.
cc @mourner @jfirebaugh @ansis
Todo
feature-filter
version https://www.npmjs.com/package/feature-filtermapbox-gl-style-spec
Add support for has / !has operators mapbox-gl-style-spec#451feature-filter
andmapbox-gl-style-spec
in GL JS