mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-06 01:47:48 +00:00
Bump to v4.0.0.
This commit is contained in:
15
internal/toFunction.js
Normal file
15
internal/toFunction.js
Normal file
@@ -0,0 +1,15 @@
|
||||
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;
|
||||
});
|
||||
Reference in New Issue
Block a user