1 var baseMatches = require('./baseMatches'),
2 baseMatchesProperty = require('./baseMatchesProperty'),
3 bindCallback = require('./bindCallback'),
4 identity = require('../utility/identity'),
5 property = require('../utility/property');
8 * The base implementation of `_.callback` which supports specifying the
9 * number of arguments to provide to `func`.
12 * @param {*} [func=_.identity] The value to convert to a callback.
13 * @param {*} [thisArg] The `this` binding of `func`.
14 * @param {number} [argCount] The number of arguments to provide to `func`.
15 * @returns {Function} Returns the callback.
17 function baseCallback(func, thisArg, argCount) {
18 var type = typeof func;
19 if (type == 'function') {
20 return thisArg === undefined
22 : bindCallback(func, thisArg, argCount);
27 if (type == 'object') {
28 return baseMatches(func);
30 return thisArg === undefined
32 : baseMatchesProperty(func, thisArg);
35 module.exports = baseCallback;