CoolFace
Datasetpublic

basant307/AI_Governance_Project

sourceHugging Faceapache-2.0updated 2mo agoView on Hugging Face
0likes48downloads
countBy.js15 linesDownload Raw Back to map
1'use strict';2 3Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });4 5function countBy(map, mapper) {6    const result = new Map();7    for (const [key, value] of map) {8        const mappedKey = mapper(value, key, map);9        result.set(mappedKey, (result.get(mappedKey) ?? 0) + 1);10    }11    return result;12}13 14exports.countBy = countBy;15 
basant307/AI_Governance_Project · CoolFace