sindresorhus / dot-prop

Get, set, or delete a property from a nested object using a dot path

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

should dotProp.has({foo: undefined}, 'foo') be true ?

qiu8310 opened this issue · comments

var a = {foo: undefined}

console.log(dotProp.has(a, 'foo'))  // false

console.log('foo' in a) // true
console.log(a.hasOwnProperty('foo'))  // true

Yes, that's a bug.

@qiu8310 Can you try #29?

I wrote a different version libs/lang/DotProp.js, and test file libs/lang/test/__DotProp.js.

Would you like to merge it?

@qiu8310 if you can prove that implementation is better (we have good perf tests here) 😄