Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
Download
80742 views
1
var isFunction = require('../lang/isFunction');
2
3
/**
4
* The base implementation of `_.functions` which creates an array of
5
* `object` function property names filtered from those provided.
6
*
7
* @private
8
* @param {Object} object The object to inspect.
9
* @param {Array} props The property names to filter.
10
* @returns {Array} Returns the new array of filtered property names.
11
*/
12
function baseFunctions(object, props) {
13
var index = -1,
14
length = props.length,
15
resIndex = -1,
16
result = [];
17
18
while (++index < length) {
19
var key = props[index];
20
if (isFunction(object[key])) {
21
result[++resIndex] = key;
22
}
23
}
24
return result;
25
}
26
27
module.exports = baseFunctions;
28
29