Files
lodash/_castFunction.js
John-David Dalton f10bb8b80b Bump to v4.10.0.
2016-04-10 22:55:59 -07:00

15 lines
321 B
JavaScript

import identity from './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;
}
export default castFunction;