main
Last change
on this file since 79a0317 was 79a0317, checked in by stefan toskovski <stefantoska84@…>, 3 days ago |
F4 Finalna Verzija
|
-
Property mode
set to
100644
|
File size:
326 bytes
|
Rev | Line | |
---|
[79a0317] | 1 | 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;
|
---|
Note:
See
TracBrowser
for help on using the repository browser.