(func, context, argCount)
| 1392 | } |
| 1393 | _.VERSION = '1.8.2'; |
| 1394 | var optimizeCb = function(func, context, argCount) { |
| 1395 | if (context === void 0) return func; |
| 1396 | switch (argCount == null ? 3 : argCount) { |
| 1397 | case 1: return function(value) { |
| 1398 | return func.call(context, value); |
| 1399 | }; |
| 1400 | case 2: return function(value, other) { |
| 1401 | return func.call(context, value, other); |
| 1402 | }; |
| 1403 | case 3: return function(value, index, collection) { |
| 1404 | return func.call(context, value, index, collection); |
| 1405 | }; |
| 1406 | case 4: return function(accumulator, value, index, collection) { |
| 1407 | return func.call(context, accumulator, value, index, collection); |
| 1408 | }; |
| 1409 | } |
| 1410 | return function() { |
| 1411 | return func.apply(context, arguments); |
| 1412 | }; |
| 1413 | }; |
| 1414 | var cb = function(value, context, argCount) { |
| 1415 | if (value == null) return _.identity; |
| 1416 | if (_.isFunction(value)) return optimizeCb(value, context, argCount); |
no outgoing calls
no test coverage detected