CoolFace
Datasetpublic

basant307/AI_Governance_Project

sourceHugging Faceapache-2.0updated 2mo agoView on Hugging Face
0likes48downloads
every.d.ts29 linesDownload Raw Back to map
1/**2 * Tests whether all entries in a Map satisfy the provided predicate function.3 *4 * This function iterates through all entries of the Map and checks if the predicate function5 * returns true for every entry. It returns true if the predicate is satisfied for all entries,6 * and false otherwise.7 *8 * @template K - The type of keys in the Map.9 * @template V - The type of values in the Map.10 * @param {Map<K, V>} map - The Map to test.11 * @param {(value: V, key: K, map: Map<K, V>) => boolean} doesMatch - A predicate function that tests each entry.12 * @returns {boolean} true if all entries satisfy the predicate, false otherwise.13 *14 * @example15 * const map = new Map([16 *   ['a', 10],17 *   ['b', 20],18 *   ['c', 30]19 * ]);20 * const result = every(map, (value) => value > 5);21 * // result will be: true22 *23 * const result2 = every(map, (value) => value > 15);24 * // result2 will be: false25 */26declare function every<K, V>(map: Map<K, V>, doesMatch: (value: V, key: K, map: Map<K, V>) => boolean): boolean;27 28export { every };29 
basant307/AI_Governance_Project · CoolFace