3
0
Fork 0
mirror of https://gitea.com/actions/setup-python.git synced 2024-11-26 03:59:34 +01:00
setup-python/node_modules/lodash/_countHolders.js

22 lines
469 B
JavaScript
Raw Normal View History

2019-06-27 03:12:00 +02:00
/**
* Gets the number of `placeholder` occurrences in `array`.
*
* @private
* @param {Array} array The array to inspect.
* @param {*} placeholder The placeholder to search for.
* @returns {number} Returns the placeholder count.
*/
function countHolders(array, placeholder) {
var length = array.length,
result = 0;
while (length--) {
if (array[length] === placeholder) {
++result;
}
}
return result;
}
module.exports = countHolders;