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

27
node_modules/es-toolkit/dist/set/some.mjs generated vendored Normal file
View File

@@ -0,0 +1,27 @@
//#region src/set/some.ts
/**
* Tests whether at least one element in a Set satisfies the provided predicate function.
*
* This function iterates through the elements of the Set and checks if the predicate function
* returns true for at least one element. It returns true if any element satisfies the predicate,
* and false otherwise.
*
* @template T - The type of elements in the Set.
* @param {Set<T>} set - The Set to test.
* @param {(value: T, value2: T, set: Set<T>) => boolean} doesMatch - A predicate function that tests each element.
* @returns {boolean} true if at least one element satisfies the predicate, false otherwise.
*
* @example
* const set = new Set([1, 2, 3]);
* const result = some(set, (value) => value > 2);
* // result will be: true
*
* const result2 = some(set, (value) => value > 5);
* // result2 will be: false
*/
function some(set, doesMatch) {
for (const value of set) if (doesMatch(value, value, set)) return true;
return false;
}
//#endregion
export { some };