You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Apr 6, 2023. It is now read-only.
I really like your library. Would you consider exposing an API that tests whether a JSON Object matches the Query? It would return a Boolean.
Currently I am wrapping your API with a method that passes the object in an array into your method and checking whether the length of the resulting array is not 0.
I figured it would be more memory efficient if an “isMatch(query, object) boolean” api was available
Imagine a case where you get a stream of JSON objects, one by one, and you are scanning each of them to see if they match a specific query. If it’s a match, you process it, if not you ignore it.
so to do this using your library, I created this function
function isMatch(query, object) {
return jql(query, [object]).length !== 0
}
...
Then somewhere in my app,
for (const object of someIterableOrGenerator()) {
if (isMatch(query, object)) {
// Do something with object
}
}
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Every section has the same text and example:
https://github.com/aprilmintacpineda/jql/blob/master/packages/jql-matcher/docs/operations/range.md
The text was updated successfully, but these errors were encountered: