CoolFace
Datasetpublic

basant307/AI_Governance_Project

sourceHugging Faceapache-2.0updated 2mo agoView on Hugging Face
0likes45downloads
_arrayAggregator.js23 linesDownload Raw Back to lodash-es
1/**2 * A specialized version of `baseAggregator` for arrays.3 *4 * @private5 * @param {Array} [array] The array to iterate over.6 * @param {Function} setter The function to set `accumulator` values.7 * @param {Function} iteratee The iteratee to transform keys.8 * @param {Object} accumulator The initial aggregated object.9 * @returns {Function} Returns `accumulator`.10 */11function arrayAggregator(array, setter, iteratee, accumulator) {12  var index = -1,13      length = array == null ? 0 : array.length;14 15  while (++index < length) {16    var value = array[index];17    setter(accumulator, value, iteratee(value), array);18  }19  return accumulator;20}21 22export default arrayAggregator;23 
basant307/AI_Governance_Project · CoolFace