Files
lodash/_toFunction.js
John-David Dalton 7293d39642 Bump to v4.1.0.
2016-01-29 01:14:13 -08:00

16 lines
339 B
JavaScript

define(['./identity'], function(identity) {
/**
* Converts `value` to a function if it's not one.
*
* @private
* @param {*} value The value to process.
* @returns {Function} Returns the function.
*/
function toFunction(value) {
return typeof value == 'function' ? value : identity;
}
return toFunction;
});