1 | var baseMatches = require('./_baseMatches'),
|
2 | baseMatchesProperty = require('./_baseMatchesProperty'),
|
3 | identity = require('./identity'),
|
4 | isArray = require('./isArray'),
|
5 | property = require('./property');
|
6 |
|
7 |
|
8 |
|
9 |
|
10 |
|
11 |
|
12 |
|
13 |
|
14 | function baseIteratee(value) {
|
15 |
|
16 |
|
17 | if (typeof value == 'function') {
|
18 | return value;
|
19 | }
|
20 | if (value == null) {
|
21 | return identity;
|
22 | }
|
23 | if (typeof value == 'object') {
|
24 | return isArray(value)
|
25 | ? baseMatchesProperty(value[0], value[1])
|
26 | : baseMatches(value);
|
27 | }
|
28 | return property(value);
|
29 | }
|
30 |
|
31 | module.exports = baseIteratee;
|