code on
|
if (isEmpty(path) || path.length === 0) { |
|
return false; |
|
} |
for the
.has() method:
if (isEmpty(path) || path.length === 0) {
return false;
}
If we are searching for an empty key and the variable being searched is an object, then it is intuitive that the object has that. It can perhaps miss all keys in the world as long as long as they have a name, but for keys with no name any object has all.
code on
object-path/index.js
Lines 160 to 162 in c540af3
.has()method:If we are searching for an empty key and the variable being searched is an object, then it is intuitive that the object has that. It can perhaps miss all keys in the world as long as long as they have a name, but for keys with no name any object has all.