Skip to content

Commit 9a92b1f

Browse files
committed
Allows some without predicate
1 parent dc3de65 commit 9a92b1f

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/system/iterable.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -315,9 +315,9 @@ export function* skip<T>(source: Iterable<T> | IterableIterator<T>, count: numbe
315315
}
316316
}
317317

318-
export function some<T>(source: Iterable<T> | IterableIterator<T>, predicate: (item: T) => boolean): boolean {
318+
export function some<T>(source: Iterable<T> | IterableIterator<T>, predicate?: (item: T) => boolean): boolean {
319319
for (const item of source) {
320-
if (predicate(item)) return true;
320+
if (predicate == null || predicate(item)) return true;
321321
}
322322
return false;
323323
}

0 commit comments

Comments
 (0)