We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Hey, I've noticed that has throws an error when I try to check a nested path in a sparse array. I believe it should return false in this case.
has
false
Example: objectPath.has({ foo: [undefined, undefined, undefined] }, 'foo.0.bar')
objectPath.has({ foo: [undefined, undefined, undefined] }, 'foo.0.bar')
Throws:
Uncaught TypeError: Cannot convert undefined or null to object(…) objectPath.has @ index.js:136
The text was updated successfully, but these errors were encountered:
Got the same error on an object property that has a null/undefined value, like
objectPath.has({ a: null }, 'a.b')
TypeError: Cannot convert undefined or null to object at hasOwnProperty (native) at Function.objectPath.has (.../object-path/index.js:136:81)
So I think this is more general than just array.
Sorry, something went wrong.
Thanks for reporting this guys I'll look into this as soon as I can. In the meantime any PR is welcome...
Fix 'has' not handling deep null/undefined values (#73)
edfaa66
Fixed in 0.11.2
thanks! 👍
No branches or pull requests
Hey, I've noticed that
has
throws an error when I try to check a nested path in a sparse array. I believe it should returnfalse
in this case.Example:
objectPath.has({ foo: [undefined, undefined, undefined] }, 'foo.0.bar')
Throws:
The text was updated successfully, but these errors were encountered: