mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-01-31 15:27:50 +00:00
16 lines
340 B
JavaScript
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;
|
|
});
|