mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-01-31 15:27:50 +00:00
22 lines
542 B
JavaScript
22 lines
542 B
JavaScript
import baseCreate from './_baseCreate';
|
|
import isFunction from './isFunction';
|
|
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 (isFunction(object.constructor) && !isPrototype(object))
|
|
? baseCreate(getPrototypeOf(object))
|
|
: {};
|
|
}
|
|
|
|
export default initCloneObject;
|