source: node_modules/es-toolkit/dist/compat/array/some.d.ts@ a762898

Last change on this file since a762898 was a762898, checked in by istevanoska <ilinastevanoska@…>, 5 months ago

Added visualizations

  • Property mode set to 100644
File size: 1.3 KB
Line 
1import { ListIterateeCustom } from '../_internal/ListIterateeCustom.js';
2import { ObjectIterateeCustom } from '../_internal/ObjectIteratee.js';
3
4/**
5 * Checks if predicate returns truthy for any element of collection.
6 *
7 * @template T
8 * @param {ArrayLike<T> | null | undefined} collection - The collection to iterate over.
9 * @param {ListIterateeCustom<T, boolean>} [predicate] - The function invoked per iteration.
10 * @returns {boolean} Returns `true` if any element passes the predicate check, else `false`.
11 *
12 * @example
13 * some([null, 0, 'yes', false], Boolean);
14 * // => true
15 */
16declare function some<T>(collection: ArrayLike<T> | null | undefined, predicate?: ListIterateeCustom<T, boolean>): boolean;
17/**
18 * Checks if predicate returns truthy for any element of collection.
19 *
20 * @template T
21 * @param {T | null | undefined} collection - The object to iterate over.
22 * @param {ObjectIterateeCustom<T, boolean>} [predicate] - The function invoked per iteration.
23 * @returns {boolean} Returns `true` if any element passes the predicate check, else `false`.
24 *
25 * @example
26 * some({ 'a': 0, 'b': 1, 'c': 0 }, function(n) { return n > 0; });
27 * // => true
28 */
29declare function some<T extends object>(collection: T | null | undefined, predicate?: ObjectIterateeCustom<T, boolean>): boolean;
30
31export { some };
Note: See TracBrowser for help on using the repository browser.