Files
lodash/_castFunction.js
John-David Dalton 76b289fe6e Bump to v4.10.0.
2016-04-10 22:53:08 -07:00

16 lines
348 B
JavaScript

define(['./identity'], function(identity) {
/**
* Casts `value` to `identity` if it's not a function.
*
* @private
* @param {*} value The value to inspect.
* @returns {Function} Returns cast function.
*/
function castFunction(value) {
return typeof value == 'function' ? value : identity;
}
return castFunction;
});