Files
lodash/_baseCastFunction.js
John-David Dalton 18d0f1d873 Bump to v4.7.0.
2016-03-31 08:47:39 -07:00

15 lines
334 B
JavaScript

var identity = require('./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;
}
module.exports = baseCastFunction;