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

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

Fix frontend appearance

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