From c1f8e317754af4f4f498d3265237855736141b4a Mon Sep 17 00:00:00 2001 From: John-David Dalton Date: Mon, 22 Feb 2016 21:36:27 -0800 Subject: [PATCH] Use `typeof` for function checks instead of `isFunction`. --- lodash.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lodash.js b/lodash.js index 0ee8025c1..2ca2ba1e3 100644 --- a/lodash.js +++ b/lodash.js @@ -5127,7 +5127,7 @@ * @returns {Object} Returns the initialized clone. */ function initCloneObject(object) { - return (isFunction(object.constructor) && !isPrototype(object)) + return (typeof object.constructor == 'function' && !isPrototype(object)) ? baseCreate(getPrototypeOf(object)) : {}; } @@ -5276,7 +5276,7 @@ */ function isPrototype(value) { var Ctor = value && value.constructor, - proto = (isFunction(Ctor) && Ctor.prototype) || objectProto; + proto = (typeof Ctor == 'function' && Ctor.prototype) || objectProto; return value === proto; } @@ -12001,7 +12001,7 @@ if (isArr) { accumulator = isArray(object) ? new Ctor : []; } else { - accumulator = isFunction(Ctor) ? baseCreate(getPrototypeOf(object)) : {}; + accumulator = typeof Ctor == 'function' ? baseCreate(getPrototypeOf(object)) : {}; } } else { accumulator = {};