UNPKG

@57block/stellar-resource-usage

Version:

A library that provides convenient ways to monitor and analyze the resources consumed by smart contracts during execution

22 lines (19 loc) 467 B
/** * 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; } export default countHolders;