basant307/AI_Governance_Project
048
1'use strict';2 3Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });4 5function reduce(set, callback, initialValue) {6 if (initialValue == null && set.size === 0) {7 throw new TypeError('Reduce of empty set with no initial value');8 }9 let accumulator = initialValue;10 for (const value of set) {11 if (accumulator == null) {12 accumulator = value;13 }14 else {15 accumulator = callback(accumulator, value, value, set);16 }17 }18 return accumulator;19}20 21exports.reduce = reduce;22 