Files
lodash/_toFunction.js
John-David Dalton bbd78fee4d Bump to v4.1.0.
2016-01-29 08:30:29 -08:00

15 lines
317 B
JavaScript

var identity = require('./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;
}
module.exports = toFunction;