0879dfeca5fb04aed1a642d96dd3a776aeaffb37
[yaffs-website] / toFunction.js
1 var identity = require('../identity');
2
3 /**
4  * Converts `value` to a function if it's not one.
5  *
6  * @private
7  * @param {*} value The value to process.
8  * @returns {Function} Returns the function.
9  */
10 function toFunction(value) {
11   return typeof value == 'function' ? value : identity;
12 }
13
14 module.exports = toFunction;