This commit is contained in:
7
src/collection/flatMap.ts
Normal file
7
src/collection/flatMap.ts
Normal file
@@ -0,0 +1,7 @@
|
||||
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;
|
||||
}
|
||||
Reference in New Issue
Block a user