Files
lodash/_initCloneObject.js
John-David Dalton 7da4c55415 Bump to v4.6.0.
2016-02-29 23:41:02 -08:00

21 lines
512 B
JavaScript

import baseCreate from './_baseCreate';
import isPrototype from './_isPrototype';
/** Built-in value references. */
var getPrototypeOf = Object.getPrototypeOf;
/**
* 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(getPrototypeOf(object))
: {};
}
export default initCloneObject;