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

Using another method for exists call #152

Merged
merged 1 commit into from
Jul 25, 2020
Merged

Using another method for exists call #152

merged 1 commit into from
Jul 25, 2020

Conversation

tindy2013
Copy link
Contributor

This PR re-implements the exists() call by using json->contains(json::json_pointer(JsonNode(name, 0).ptr)); instead of json->find(), which allows you to call exists("array.1.name") safely with no throw regardless of the existence of the array, the item in this array, or the name key in this item, so that you don't need to exists("array"), existsIn("1", array) and existsIn("name", array.1).

@pantor pantor merged commit 38002d2 into pantor:master Jul 25, 2020
@pantor
Copy link
Owner

pantor commented Jul 25, 2020

Looks good to me!

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.

2 participants