Return null when value not found#9
Merged
Merged
Conversation
…d, but the doc does not contain the given value.
Owner
|
Agreed. Note to self. this breaks BC and we must bump to version 2.x.y. |
Contributor
Author
|
Agree with BC issue. Wait for compile patch before releasing 2.x though? |
Owner
|
Can do, but no biggie, I am fast and loose with major version numbers, I wouldn’t mind shipping 2.0.0 tonight and 3.0.0 tomorrow ;) I’ll play it by ear if anyone wants this in a release asap, if not it can wait. |
Contributor
|
I can use this fix. What's the compile patch? |
Owner
|
hm? |
Contributor
|
It was @hildjj that said "Wait for compile patch before releasing 2.x though?" Another note, it ought to return undefined rather than null. That would be a convenient way to differentiate between finding "null" and not finding the key at all. |
Contributor
Author
|
I was talking about hildjj/node-jsonpointer@1c373d5 |
Owner
|
@benatkin good point, wanna open a new issue? |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Throwing an exception is for exceptional cases. Not finding the target data doesn't feel like an exceptional case, particularly if I'm going to use the pointer as a filter to select from a set of objects that might match.