source: frontend/node_modules/underscore/modules/_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: 764 bytes
Line 
1import identity from './identity.js';
2import isFunction from './isFunction.js';
3import isObject from './isObject.js';
4import isArray from './isArray.js';
5import matcher from './matcher.js';
6import property from './property.js';
7import optimizeCb from './_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.
12export default function 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}
Note: See TracBrowser for help on using the repository browser.