Initial commit
[yaffs-website] / node_modules / grunt-contrib-watch / node_modules / lodash / internal / isLaziable.js
1 var LazyWrapper = require('./LazyWrapper'),
2     getData = require('./getData'),
3     getFuncName = require('./getFuncName'),
4     lodash = require('../chain/lodash');
5
6 /**
7  * Checks if `func` has a lazy counterpart.
8  *
9  * @private
10  * @param {Function} func The function to check.
11  * @returns {boolean} Returns `true` if `func` has a lazy counterpart, else `false`.
12  */
13 function isLaziable(func) {
14   var funcName = getFuncName(func),
15       other = lodash[funcName];
16
17   if (typeof other != 'function' || !(funcName in LazyWrapper.prototype)) {
18     return false;
19   }
20   if (func === other) {
21     return true;
22   }
23   var data = getData(other);
24   return !!data && func === data[0];
25 }
26
27 module.exports = isLaziable;