b1da6cb7a747aa8f26baf2367c175d68881ab596
[yaffs-website] / node_modules / grunt-legacy-util / node_modules / lodash / _initCloneObject.js
1 var baseCreate = require('./_baseCreate'),
2     isFunction = require('./isFunction'),
3     isPrototype = require('./_isPrototype');
4
5 /**
6  * Initializes an object clone.
7  *
8  * @private
9  * @param {Object} object The object to clone.
10  * @returns {Object} Returns the initialized clone.
11  */
12 function initCloneObject(object) {
13   if (isPrototype(object)) {
14     return {};
15   }
16   var Ctor = object.constructor;
17   return baseCreate(isFunction(Ctor) ? Ctor.prototype : undefined);
18 }
19
20 module.exports = initCloneObject;