DRAFT: implement sequence
This commit is contained in:
6
src/sequence/flatMapIndexed.ts
Normal file
6
src/sequence/flatMapIndexed.ts
Normal file
@@ -0,0 +1,6 @@
|
||||
export function* flatMapIndexed<T, R>(value: Iterable<T>, transform: (index: number, it: T) => Iterable<R>): Iterable<R> {
|
||||
let index = 0;
|
||||
for (const it of value) {
|
||||
yield* transform(index++, it);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user