Sha256: 43b28f9d1c013f46531de9845b951abb811c4bd794b8baf051dee0d0919a3edc
Contents?: true
Size: 1.13 KB
Versions: 14
Compression:
Stored size: 1.13 KB
Contents
var baseMatches = require('./baseMatches'), baseMatchesProperty = require('./baseMatchesProperty'), baseProperty = require('./baseProperty'), bindCallback = require('./bindCallback'), identity = require('../utility/identity'), isBindable = require('./isBindable'); /** * The base implementation of `_.callback` which supports specifying the * number of arguments to provide to `func`. * * @private * @param {*} [func=_.identity] The value to convert to a callback. * @param {*} [thisArg] The `this` binding of `func`. * @param {number} [argCount] The number of arguments to provide to `func`. * @returns {Function} Returns the callback. */ function baseCallback(func, thisArg, argCount) { var type = typeof func; if (type == 'function') { return (typeof thisArg != 'undefined' && isBindable(func)) ? bindCallback(func, thisArg, argCount) : func; } if (func == null) { return identity; } if (type == 'object') { return baseMatches(func); } return typeof thisArg == 'undefined' ? baseProperty(func + '') : baseMatchesProperty(func + '', thisArg); } module.exports = baseCallback;
Version data entries
14 entries across 7 versions & 1 rubygems