mirror of
https://gitlab.com/lecarore/breakout71.git
synced 2025-04-21 04:26:14 -04:00
Build 29068563
This commit is contained in:
parent
6ef13f2d19
commit
df8bfbb350
25 changed files with 384 additions and 336 deletions
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue