|
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 | |
|---|
| 1 | var identity = require('./identity.js');
|
|---|
| 2 | var isFunction = require('./isFunction.js');
|
|---|
| 3 | var isObject = require('./isObject.js');
|
|---|
| 4 | var isArray = require('./isArray.js');
|
|---|
| 5 | var matcher = require('./matcher.js');
|
|---|
| 6 | var property = require('./property.js');
|
|---|
| 7 | var _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.
|
|---|
| 12 | 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 | }
|
|---|
| 18 |
|
|---|
| 19 | module.exports = baseIteratee;
|
|---|
Note:
See
TracBrowser
for help on using the repository browser.