mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-04 00:57:48 +00:00
Bump to v3.0.0.
This commit is contained in:
24
internal/baseCreate.js
Normal file
24
internal/baseCreate.js
Normal file
@@ -0,0 +1,24 @@
|
||||
import isObject from '../lang/isObject';
|
||||
import root from './root';
|
||||
|
||||
/**
|
||||
* The base implementation of `_.create` without support for assigning
|
||||
* properties to the created object.
|
||||
*
|
||||
* @private
|
||||
* @param {Object} prototype The object to inherit from.
|
||||
* @returns {Object} Returns the new object.
|
||||
*/
|
||||
var baseCreate = (function() {
|
||||
function Object() {}
|
||||
return function(prototype) {
|
||||
if (isObject(prototype)) {
|
||||
Object.prototype = prototype;
|
||||
var result = new Object;
|
||||
Object.prototype = null;
|
||||
}
|
||||
return result || root.Object();
|
||||
};
|
||||
}());
|
||||
|
||||
export default baseCreate;
|
||||
Reference in New Issue
Block a user