DieselDepot-APP/node_modules/es-toolkit/dist/map/every.d.mts
SJCoetz def597c157 chore: add generated build artifacts and node module type files
add all Next.js build outputs and third-party dependency type declaration files
2026-07-20 01:18:42 +02:00

29 lines
No EOL
1,003 B
TypeScript

//#region src/map/every.d.ts
/**
* Tests whether all entries in a Map satisfy the provided predicate function.
*
* This function iterates through all entries of the Map and checks if the predicate function
* returns true for every entry. It returns true if the predicate is satisfied for all entries,
* and false otherwise.
*
* @template K - The type of keys in the Map.
* @template V - The type of values in the Map.
* @param map - The Map to test.
* @param doesMatch - A predicate function that tests each entry.
* @returns true if all entries satisfy the predicate, false otherwise.
*
* @example
* const map = new Map([
* ['a', 10],
* ['b', 20],
* ['c', 30]
* ]);
* const result = every(map, (value) => value > 5);
* // result will be: true
*
* const result2 = every(map, (value) => value > 15);
* // result2 will be: false
*/
declare function every<K, V>(map: Map<K, V>, doesMatch: (value: V, key: K, map: Map<K, V>) => boolean): boolean;
//#endregion
export { every };