Project Init

This commit is contained in:
Muluhabt
2026-05-29 15:23:46 +03:00
commit 2fbc557aac
67387 changed files with 6063341 additions and 0 deletions

32
node_modules/es-toolkit/dist/map/forEach.mjs generated vendored Normal file
View File

@@ -0,0 +1,32 @@
//#region src/map/forEach.ts
/**
* Executes a provided function once for each entry in a Map.
*
* This function iterates through all entries of the Map and executes the callback function
* for each entry. The callback receives the value, key, and the Map itself as arguments.
*
* @template K - The type of keys in the Map.
* @template V - The type of values in the Map.
* @param {Map<K, V>} map - The Map to iterate over.
* @param {(value: V, key: K, map: Map<K, V>) => void} callback - A function to execute for each entry.
* @returns {void}
*
* @example
* const map = new Map([
* ['a', 1],
* ['b', 2],
* ['c', 3]
* ]);
* forEach(map, (value, key) => {
* console.log(`${key}: ${value}`);
* });
* // Output:
* // a: 1
* // b: 2
* // c: 3
*/
function forEach(map, callback) {
for (const [key, value] of map) callback(value, key, map);
}
//#endregion
export { forEach };