UNPKG

@newdash/newdash

Version:

javascript/typescript utility library

32 lines (31 loc) 958 B
"use strict"; var __importDefault = (this && this.__importDefault) || function (mod) { return (mod && mod.__esModule) ? mod : { "default": mod }; }; Object.defineProperty(exports, "__esModule", { value: true }); const isObject_1 = __importDefault(require("../isObject")); const objectCreate = Object.create; /** * The base implementation of `create` without support for assigning * properties to the created object. * * @private * @param {Object} proto The object to inherit from. * @returns {Object} Returns the new object. */ const baseCreate = (function () { function object() { } return function (proto) { if (!(0, isObject_1.default)(proto)) { return {}; } if (objectCreate) { return objectCreate(proto); } object.prototype = proto; var result = new object; object.prototype = undefined; return result; }; }()); exports.default = baseCreate;