Sha256: d7b164a9bfc94ce4df4c26d318fbec98320fc8c26a0d9dabd011efde368048f1

Contents?: true

Size: 326 Bytes

Versions: 291

Compression:

Stored size: 326 Bytes

Contents

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;

Version data entries

291 entries across 267 versions & 32 rubygems

Version Path
optimacms-0.4.2 spec/dummy/node_modules/lodash/_castFunction.js
locomotivecms-4.0.0.alpha1 app/javascript/node_modules/lodash/_castFunction.js
lux_assets-0.2.11 ./node_modules/lodash/_castFunction.js
lux_assets-0.2.9 ./node_modules/lodash/_castFunction.js
lux_assets-0.2.4 ./node_modules/lodash/_castFunction.js
lux_assets-0.2.2 ./node_modules/lodash/_castFunction.js
lux_assets-0.2.1 ./node_modules/lodash/_castFunction.js
ela-4.1.2 node_modules/lodash/_castFunction.js
sumomo-0.8.4 data/sumomo/api_modules/node_modules/lodash/_castFunction.js
ela-4.1.1 node_modules/lodash/_castFunction.js
ela-4.1.0 node_modules/lodash/_castFunction.js
locomotivecms-3.4.0 app/javascript/node_modules/lodash/_castFunction.js
cortex-0.1.3 spec/dummy/node_modules/lodash/_castFunction.js
sumomo-0.8.3 data/sumomo/api_modules/node_modules/lodash/_castFunction.js
sumomo-0.8.2 data/sumomo/api_modules/node_modules/lodash/_castFunction.js
sumomo-0.8.1 data/sumomo/api_modules/node_modules/lodash/_castFunction.js
condenser-0.0.4 lib/condenser/processors/node_modules/lodash/_castFunction.js
ela-4.0.0 node_modules/lodash/_castFunction.js
ela-3.4.3 node_modules/lodash/_castFunction.js
ela-3.4.2 node_modules/lodash/_castFunction.js