mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-01-29 14:37:49 +00:00
15 lines
312 B
JavaScript
15 lines
312 B
JavaScript
import identity from './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;
|
|
}
|
|
|
|
export default toFunction;
|