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

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