Files
collection.ts/src/collection/flatMap.ts
Infendro 24838b8f77
All checks were successful
/ publish (push) Successful in 1m24s
Implement Collection
2026-04-27 19:00:49 +02:00

8 lines
208 B
TypeScript

export function flatMap<T, R>(value: T[], transform: (it: T) => Iterable<R>): R[] {
const result: R[] = [];
for (const it of value) {
result.push(...transform(it));
}
return result;
}