UNPKG

@newdash/newdash

Version:

javascript/typescript utility library

20 lines (19 loc) 669 B
"use strict"; var __importDefault = (this && this.__importDefault) || function (mod) { return (mod && mod.__esModule) ? mod : { "default": mod }; }; Object.defineProperty(exports, "__esModule", { value: true }); const isPrototype_1 = __importDefault(require("./isPrototype")); /** * 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' && !(0, isPrototype_1.default)(object)) ? Object.create(Object.getPrototypeOf(object)) : {}; } exports.default = initCloneObject;