mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-04 17:07:49 +00:00
Modularize master branch.
This commit is contained in:
14
_castFunction.js
Normal file
14
_castFunction.js
Normal file
@@ -0,0 +1,14 @@
|
||||
import identity from './identity.js';
|
||||
|
||||
/**
|
||||
* 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;
|
||||
}
|
||||
|
||||
export default castFunction;
|
||||
Reference in New Issue
Block a user