|
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 | |
|---|
| 1 | import identity from './identity.js';
|
|---|
| 2 | import isFunction from './isFunction.js';
|
|---|
| 3 | import isObject from './isObject.js';
|
|---|
| 4 | import isArray from './isArray.js';
|
|---|
| 5 | import matcher from './matcher.js';
|
|---|
| 6 | import property from './property.js';
|
|---|
| 7 | import 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.
|
|---|
| 12 | export 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.