Files
lodash/internal/toFunction.js
John-David Dalton 8c26e6fd4c Bump to v4.0.0.
2016-01-13 01:10:19 -08:00

16 lines
340 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;
});