您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

_castFunction.js 326B

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;