source: frontend/node_modules/underscore/amd/_baseIteratee.js

Last change on this file was 9af201e, checked in by MBK <marija.karapandzova@…>, 12 days ago

Fix frontend appearance

  • Property mode set to 100644
File size: 721 bytes
Line 
1define(['./identity', './isFunction', './isObject', './isArray', './matcher', './property', './_optimizeCb'], function (identity, isFunction, isObject, isArray, matcher, property, _optimizeCb) {
2
3 // An internal function to generate callbacks that can be applied to each
4 // element in a collection, returning the desired result — either `_.identity`,
5 // an arbitrary callback, a property matcher, or a property accessor.
6 function baseIteratee(value, context, argCount) {
7 if (value == null) return identity;
8 if (isFunction(value)) return _optimizeCb(value, context, argCount);
9 if (isObject(value) && !isArray(value)) return matcher(value);
10 return property(value);
11 }
12
13 return baseIteratee;
14
15});
Note: See TracBrowser for help on using the repository browser.