mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-01-29 14:37:49 +00:00
15 lines
334 B
JavaScript
15 lines
334 B
JavaScript
import identity from './identity';
|
|
|
|
/**
|
|
* Casts `value` to `identity` if it's not a function.
|
|
*
|
|
* @private
|
|
* @param {*} value The value to inspect.
|
|
* @returns {Array} Returns the array-like object.
|
|
*/
|
|
function baseCastFunction(value) {
|
|
return typeof value == 'function' ? value : identity;
|
|
}
|
|
|
|
export default baseCastFunction;
|