Build 29068563

This commit is contained in:
Renan LE CARO 2025-04-08 14:03:38 +02:00
parent 6ef13f2d19
commit df8bfbb350
25 changed files with 384 additions and 336 deletions

View file

@ -65,3 +65,13 @@ export function miniMarkDown(md: string) {
)
.join("\n");
}
export function firstWhere<Input, Output>(
arr: Input[],
mapper: (item: Input, index: number) => Output | undefined,
): Output | undefined {
for (let i = 0; i < arr.length; i++) {
const result = mapper(arr[i], i);
if (typeof result !== "undefined") return result;
}
}