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