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

1234567891011121314
  1. var isArray = require('./isArray.js');
  2. var _deepGet = require('./_deepGet.js');
  3. // Generates a function for a given object that returns a given property.
  4. function propertyOf(obj) {
  5. if (obj == null) {
  6. return function(){};
  7. }
  8. return function(path) {
  9. return !isArray(path) ? obj[path] : _deepGet(obj, path);
  10. };
  11. }
  12. module.exports = propertyOf;