Files
lodash/_baseCastFunction.js
John-David Dalton ce0b51888c Bump to v4.7.0.
2016-03-31 00:36:47 -07:00

15 lines
329 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 baseCastFunction(value) {
return typeof value == 'function' ? value : identity;
}
export default baseCastFunction;