mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-12 03:47:50 +00:00
Use typeof for function checks instead of isFunction.
This commit is contained in:
@@ -5127,7 +5127,7 @@
|
|||||||
* @returns {Object} Returns the initialized clone.
|
* @returns {Object} Returns the initialized clone.
|
||||||
*/
|
*/
|
||||||
function initCloneObject(object) {
|
function initCloneObject(object) {
|
||||||
return (isFunction(object.constructor) && !isPrototype(object))
|
return (typeof object.constructor == 'function' && !isPrototype(object))
|
||||||
? baseCreate(getPrototypeOf(object))
|
? baseCreate(getPrototypeOf(object))
|
||||||
: {};
|
: {};
|
||||||
}
|
}
|
||||||
@@ -5276,7 +5276,7 @@
|
|||||||
*/
|
*/
|
||||||
function isPrototype(value) {
|
function isPrototype(value) {
|
||||||
var Ctor = value && value.constructor,
|
var Ctor = value && value.constructor,
|
||||||
proto = (isFunction(Ctor) && Ctor.prototype) || objectProto;
|
proto = (typeof Ctor == 'function' && Ctor.prototype) || objectProto;
|
||||||
|
|
||||||
return value === proto;
|
return value === proto;
|
||||||
}
|
}
|
||||||
@@ -12001,7 +12001,7 @@
|
|||||||
if (isArr) {
|
if (isArr) {
|
||||||
accumulator = isArray(object) ? new Ctor : [];
|
accumulator = isArray(object) ? new Ctor : [];
|
||||||
} else {
|
} else {
|
||||||
accumulator = isFunction(Ctor) ? baseCreate(getPrototypeOf(object)) : {};
|
accumulator = typeof Ctor == 'function' ? baseCreate(getPrototypeOf(object)) : {};
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
accumulator = {};
|
accumulator = {};
|
||||||
|
|||||||
Reference in New Issue
Block a user