mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-07 01:57:50 +00:00
Move getData function guard to `isLaziable.
This commit is contained in:
committed by
John-David Dalton
parent
a2dd7171a5
commit
816f37bdc5
@@ -3998,7 +3998,7 @@
|
|||||||
* @returns {*} Returns the metadata for `func`.
|
* @returns {*} Returns the metadata for `func`.
|
||||||
*/
|
*/
|
||||||
var getData = !metaMap ? noop : function(func) {
|
var getData = !metaMap ? noop : function(func) {
|
||||||
return typeof func == 'function' ? metaMap.get(func) : undefined;
|
return metaMap.get(func);
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -4280,11 +4280,12 @@
|
|||||||
* @returns {boolean} Returns `true` if `func` has a lazy counterpart, else `false`.
|
* @returns {boolean} Returns `true` if `func` has a lazy counterpart, else `false`.
|
||||||
*/
|
*/
|
||||||
function isLaziable(func) {
|
function isLaziable(func) {
|
||||||
var funcName = getFuncName(func);
|
var funcName = getFuncName(func),
|
||||||
if (!(funcName in LazyWrapper.prototype)) {
|
other = lodash[funcName];
|
||||||
|
|
||||||
|
if (typeof other != 'function' || !(funcName in LazyWrapper.prototype)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
var other = lodash[funcName];
|
|
||||||
if (func === other) {
|
if (func === other) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user