Files
lodash/_initCloneObject.js
John-David Dalton ce0b51888c Bump to v4.7.0.
2016-03-31 00:36:47 -07:00

19 lines
475 B
JavaScript

import baseCreate from './_baseCreate';
import getPrototype from './_getPrototype';
import isPrototype from './_isPrototype';
/**
* Initializes an object clone.
*
* @private
* @param {Object} object The object to clone.
* @returns {Object} Returns the initialized clone.
*/
function initCloneObject(object) {
return (typeof object.constructor == 'function' && !isPrototype(object))
? baseCreate(getPrototype(object))
: {};
}
export default initCloneObject;