-
Notifications
You must be signed in to change notification settings - Fork 33
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
ObjectID.isValid should check that typeof toString === 'function'
otherwise if it's not an object and doesn't have a toString
then it would return false
#27
Comments
e.g. if you pass an empty plain object to |
Specifically https://github.com/williamkapke/bson-objectid/blob/master/objectid.js#L98 should change to |
seems right. I'm happy to take a PR for it! |
roger, PR inbound |
@williamkapke see #28, I also added a test case as well. let me know of any issues, or when a new version is published to npm. thanks many! 👍 |
fix: fixed ObjectID.isValid logic (closes #27)
No description provided.
The text was updated successfully, but these errors were encountered: