mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-11 11:27:50 +00:00
Remove nullish checks from baseHas and baseHasIn.
This commit is contained in:
@@ -2511,9 +2511,6 @@
|
|||||||
* @returns {boolean} Returns `true` if `key` exists, else `false`.
|
* @returns {boolean} Returns `true` if `key` exists, else `false`.
|
||||||
*/
|
*/
|
||||||
function baseHas(object, key) {
|
function baseHas(object, key) {
|
||||||
if (object == null) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
// Avoid a bug in IE 10-11 where objects with a [[Prototype]] of `null`
|
// Avoid a bug in IE 10-11 where objects with a [[Prototype]] of `null`
|
||||||
// incorrectly report `false` for own index properties.
|
// incorrectly report `false` for own index properties.
|
||||||
return hasOwnProperty.call(object, key) ||
|
return hasOwnProperty.call(object, key) ||
|
||||||
@@ -2529,7 +2526,7 @@
|
|||||||
* @returns {boolean} Returns `true` if `key` exists, else `false`.
|
* @returns {boolean} Returns `true` if `key` exists, else `false`.
|
||||||
*/
|
*/
|
||||||
function baseHasIn(object, key) {
|
function baseHasIn(object, key) {
|
||||||
return object != null && key in Object(object);
|
return key in Object(object);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Reference in New Issue
Block a user