Files
lodash/_initCloneObject.js
John-David Dalton 7293d39642 Bump to v4.1.0.
2016-01-29 01:14:13 -08:00

23 lines
601 B
JavaScript

define(['./_baseCreate', './isFunction', './_isPrototype'], function(baseCreate, isFunction, isPrototype) {
/** Used as a safe reference for `undefined` in pre-ES5 environments. */
var undefined;
/**
* Initializes an object clone.
*
* @private
* @param {Object} object The object to clone.
* @returns {Object} Returns the initialized clone.
*/
function initCloneObject(object) {
if (isPrototype(object)) {
return {};
}
var Ctor = object.constructor;
return baseCreate(isFunction(Ctor) ? Ctor.prototype : undefined);
}
return initCloneObject;
});