mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-01 07:47:49 +00:00
Bump to v4.1.0.
This commit is contained in:
20
_initCloneObject.js
Normal file
20
_initCloneObject.js
Normal file
@@ -0,0 +1,20 @@
|
||||
var baseCreate = require('./_baseCreate'),
|
||||
isFunction = require('./isFunction'),
|
||||
isPrototype = require('./_isPrototype');
|
||||
|
||||
/**
|
||||
* 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);
|
||||
}
|
||||
|
||||
module.exports = initCloneObject;
|
||||
Reference in New Issue
Block a user