mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-05 09:27:49 +00:00
Reduce use of undefined literal.
This commit is contained in:
12
lodash.js
12
lodash.js
@@ -1718,7 +1718,7 @@
|
|||||||
forIn(value, function(value, key) {
|
forIn(value, function(value, key) {
|
||||||
result = key;
|
result = key;
|
||||||
});
|
});
|
||||||
return result === undefined || hasOwnProperty.call(value, result);
|
return typeof result == 'undefined' || hasOwnProperty.call(value, result);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -4385,7 +4385,7 @@
|
|||||||
// juggle arguments
|
// juggle arguments
|
||||||
if (typeof isShallow != 'boolean' && isShallow != null) {
|
if (typeof isShallow != 'boolean' && isShallow != null) {
|
||||||
thisArg = callback;
|
thisArg = callback;
|
||||||
callback = !(thisArg && thisArg[isShallow] === array) ? isShallow : undefined;
|
callback = !(thisArg && thisArg[isShallow] === array) ? isShallow : null;
|
||||||
isShallow = false;
|
isShallow = false;
|
||||||
}
|
}
|
||||||
if (callback != null) {
|
if (callback != null) {
|
||||||
@@ -5013,7 +5013,7 @@
|
|||||||
// juggle arguments
|
// juggle arguments
|
||||||
if (typeof isSorted != 'boolean' && isSorted != null) {
|
if (typeof isSorted != 'boolean' && isSorted != null) {
|
||||||
thisArg = callback;
|
thisArg = callback;
|
||||||
callback = !(thisArg && thisArg[isSorted] === array) ? isSorted : undefined;
|
callback = !(thisArg && thisArg[isSorted] === array) ? isSorted : null;
|
||||||
isSorted = false;
|
isSorted = false;
|
||||||
}
|
}
|
||||||
if (callback != null) {
|
if (callback != null) {
|
||||||
@@ -5995,8 +5995,10 @@
|
|||||||
* // => 'nonsense'
|
* // => 'nonsense'
|
||||||
*/
|
*/
|
||||||
function result(object, property) {
|
function result(object, property) {
|
||||||
var value = object ? object[property] : undefined;
|
if (object) {
|
||||||
return isFunction(value) ? object[property]() : value;
|
var value = object[property];
|
||||||
|
return isFunction(value) ? object[property]() : value;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Reference in New Issue
Block a user