has() should use Object.prototype.hasOwnProperty()
vibl opened this issue · 2 comments
Currently in Rambda, has()
checks whether the value is undefined
, which is not what the doc says it does ("It returns true if obj has property prop.").
Instead, has()
should use Object.prototype.hasOwnProperty()
, as it does in Ramda. I have been bitten by this undocumented incompatibility.
Also, for reference, in Lodash, _.has({a: undefined}, 'a') === true
Thanks @vibl for this suggestion. In order to properly fix it, I'll need to check in which other methods it makes sense to be used. I will get back with this list and timeline for the fix.
6.8.0
fixes that in R.has
. Sorry for taking so long to complete the release.
I am closing the issue, but I put label in_progress
as might add it to other methods as well.