• File: _castFunction.js
  • Full Path: /var/www/nodejs/callDir/node_modules/lodash/_castFunction.js
  • Date Modified: 06/03/2024 5:11 PM
  • File size: 326 bytes
  • MIME-type: text/plain
  • Charset: utf-8
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;