aswi2020vldc-gitlab/templetes/node_modules/lodash/_castFunction.js @ 5fded919
1 | 3a515b92 | cagy | var identity = require('./identity'); |
---|---|---|---|
2 | |||
3 | /**
|
||
4 | * Casts `value` to `identity` if it's not a function.
|
||
5 | *
|
||
6 | * @private
|
||
7 | * @param {*} value The value to inspect.
|
||
8 | * @returns {Function} Returns cast function.
|
||
9 | */
|
||
10 | function castFunction(value) { |
||
11 | return typeof value == 'function' ? value : identity; |
||
12 | }
|
||
13 | |||
14 | module.exports = castFunction; |