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

_baseIteratee.js 721B

123456789101112131415
  1. define(['./isObject', './identity', './isFunction', './isArray', './matcher', './property', './_optimizeCb'], function (isObject, identity, isFunction, isArray, matcher, property, _optimizeCb) {
  2. // An internal function to generate callbacks that can be applied to each
  3. // element in a collection, returning the desired result — either `_.identity`,
  4. // an arbitrary callback, a property matcher, or a property accessor.
  5. function baseIteratee(value, context, argCount) {
  6. if (value == null) return identity;
  7. if (isFunction(value)) return _optimizeCb(value, context, argCount);
  8. if (isObject(value) && !isArray(value)) return matcher(value);
  9. return property(value);
  10. }
  11. return baseIteratee;
  12. });