89b553ae957a14a0de27e83b54e3f01c97684128e4d303779428802c679f22e8e281209c9c061707ec4146597f8857f0a8b0b068699349a0569b6afeb82119 326 B

1234567891011121314
  1. var identity = require('./identity');
  2. /**
  3. * Casts `value` to `identity` if it's not a function.
  4. *
  5. * @private
  6. * @param {*} value The value to inspect.
  7. * @returns {Function} Returns cast function.
  8. */
  9. function castFunction(value) {
  10. return typeof value == 'function' ? value : identity;
  11. }
  12. module.exports = castFunction;