mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-03 00:27:50 +00:00
Bump to v4.10.0.
This commit is contained in:
14
_castFunction.js
Normal file
14
_castFunction.js
Normal file
@@ -0,0 +1,14 @@
|
||||
var identity = require('./identity');
|
||||
|
||||
/**
|
||||
* Casts `value` to `identity` if it's not a function.
|
||||
*
|
||||
* @private
|
||||
* @param {*} value The value to inspect.
|
||||
* @returns {Function} Returns cast function.
|
||||
*/
|
||||
function castFunction(value) {
|
||||
return typeof value == 'function' ? value : identity;
|
||||
}
|
||||
|
||||
module.exports = castFunction;
|
||||
Reference in New Issue
Block a user