Repositorio del curso CCOM4030 el semestre B91 del proyecto Artesanías con el Instituto de Cultura

123456789101112131415161718192021222324252627282930
  1. var isObject = require('./isObject');
  2. /** Built-in value references. */
  3. var objectCreate = Object.create;
  4. /**
  5. * The base implementation of `_.create` without support for assigning
  6. * properties to the created object.
  7. *
  8. * @private
  9. * @param {Object} proto The object to inherit from.
  10. * @returns {Object} Returns the new object.
  11. */
  12. var baseCreate = (function() {
  13. function object() {}
  14. return function(proto) {
  15. if (!isObject(proto)) {
  16. return {};
  17. }
  18. if (objectCreate) {
  19. return objectCreate(proto);
  20. }
  21. object.prototype = proto;
  22. var result = new object;
  23. object.prototype = undefined;
  24. return result;
  25. };
  26. }());
  27. module.exports = baseCreate;