|
Last change
on this file was a762898, checked in by istevanoska <ilinastevanoska@…>, 5 months ago |
|
Added visualizations
|
-
Property mode
set to
100644
|
|
File size:
1.3 KB
|
| Line | |
|---|
| 1 | import { ListIterateeCustom } from '../_internal/ListIterateeCustom.js';
|
|---|
| 2 | import { 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 | */
|
|---|
| 16 | declare 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 | */
|
|---|
| 29 | declare function some<T extends object>(collection: T | null | undefined, predicate?: ObjectIterateeCustom<T, boolean>): boolean;
|
|---|
| 30 |
|
|---|
| 31 | export { some };
|
|---|
Note:
See
TracBrowser
for help on using the repository browser.