Inconsistent behaviour of `pathOr` and `propOr`
Hey all, I am puzzled because of the output of the following snippet:
console.log(R.pathOr({}, ['some'], { some: undefined }) === undefined) // false
console.log(R.pathOr({}, ['some'], {}) === undefined) // false
console.log(R.propOr({}, 'some', { some: undefined }) === undefined) // true
console.log(R.propOr({}, 'some', {}) === undefined) // false
I found this confusing and had a look at the implementation which confused me more since propOr just proxies the call to pathOr: https://github.com/ramda/ramda/blob/master/source/propOr.js#L32 => how can the behaviour be different?
Furthermore, the documentation says:
If the given, non-null object has an own property with the specified name, returns the value of that property.
The wording "has own property" leads imo to the understanding that hasOwnProperty is actually used in the implementation. Imo that would also explain the behaviour from above since:
Object.hasOwnProperty.call({ test: undefined }, 'test'); // true
What am I missing here and could the documentation be more explicit in some way?
Update: I had a look at the test cases: https://github.com/ramda/ramda/blob/master/test/propOr.js#L27 this test seems to contradict with the code snippet, am I right?
We simply have not had a release since that was fixed. It should work soon.
Perfect, will close this one then.