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

123456789101112
  1. import isArray from './isArray.js';
  2. import deepGet from './_deepGet.js';
  3. // Generates a function for a given object that returns a given property.
  4. export default 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. }