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

Return null when value not found #9

Merged
merged 1 commit into from
Jan 20, 2013
Merged

Return null when value not found #9

merged 1 commit into from
Jan 20, 2013

Conversation

hildjj
Copy link
Contributor

@hildjj hildjj commented Jan 20, 2013

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.

…d, but the doc does not contain the given value.
@janl
Copy link
Owner

janl commented Jan 20, 2013

Agreed.

Note to self. this breaks BC and we must bump to version 2.x.y.

janl added a commit that referenced this pull request Jan 20, 2013
Return null when value not found
@janl janl merged commit 99a7865 into janl:master Jan 20, 2013
@hildjj
Copy link
Contributor Author

hildjj commented Jan 20, 2013

Agree with BC issue. Wait for compile patch before releasing 2.x though?

@janl
Copy link
Owner

janl commented Jan 20, 2013

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.

@benatkin
Copy link
Contributor

I can use this fix. What's the compile patch?

@janl
Copy link
Owner

janl commented Jun 14, 2013

hm?

@benatkin
Copy link
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.

@hildjj
Copy link
Contributor Author

hildjj commented Jun 15, 2013

I was talking about hildjj/node-jsonpointer@1c373d5

@janl
Copy link
Owner

janl commented Jun 15, 2013

@benatkin good point, wanna open a new issue?

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.

3 participants