Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
Download
80742 views
1
var isObject = require('../lang/isObject');
2
3
/**
4
* The base implementation of `_.create` without support for assigning
5
* properties to the created object.
6
*
7
* @private
8
* @param {Object} prototype The object to inherit from.
9
* @returns {Object} Returns the new object.
10
*/
11
var baseCreate = (function() {
12
function object() {}
13
return function(prototype) {
14
if (isObject(prototype)) {
15
object.prototype = prototype;
16
var result = new object;
17
object.prototype = null;
18
}
19
return result || {};
20
};
21
}());
22
23
module.exports = baseCreate;
24
25