Files
lodash/internal/toFunction.js
John-David Dalton 54e7baecc3 Bump to v4.0.0.
2016-01-12 00:17:29 -08:00

15 lines
313 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;