DRAFT: implement sequence

This commit is contained in:
2026-04-23 22:54:07 +02:00
parent 6c7fad267c
commit e2a18101cf
85 changed files with 1142 additions and 1 deletions

8
src/sequence/first.ts Normal file
View File

@@ -0,0 +1,8 @@
import {error} from "../util/error.js";
export function first<T>(value: Iterable<T>, predicate?: (it: T) => boolean): T {
for (const it of value) {
if (!predicate || predicate(it)) return it;
}
error();
}