mirror of
https://github.com/lensapp/lens.git
synced 2025-05-20 05:10:56 +00:00
Fix type errors
Signed-off-by: Sebastian Malton <sebastian@malton.name>
This commit is contained in:
1 parent
cb538bf716
commit
b5178c7cdf
5 files changed
+35
-29
No files matched your search
@@ -11,6 +11,8 @@ interface Iterator<T> extends Iterable<T> {
|
||||
find(fn: (val: T) => unknown): T | undefined;
|
||||
collect<U>(fn: (values: Iterable<T>) => U): U;
|
||||
toArray(): T[];
|
||||
toMap(): T extends [infer K, infer V] ? Map<K, V> : never;
|
||||
toSet(): Set<T>;
|
||||
map<U>(fn: (val: T) => U): Iterator<U>;
|
||||
flatMap<U>(fn: (val: T) => U[]): Iterator<U>;
|
||||
concat(src2: IterableIterator<T>): Iterator<T>;
|
||||
@@ -28,6 +30,8 @@ function chain<T>(src: IterableIterator<T>): Iterator<T> {
|
||||
join: (sep) => join(src, sep),
|
||||
collect: (fn) => fn(src),
|
||||
toArray: () => [...src],
|
||||
toMap: () => new Map(src as IterableIterator<[any, any]>) as any,
|
||||
toSet: () => new Set(src),
|
||||
concat: (src2) => chain(concat(src, src2)),
|
||||
take: (count) => chain(take(src, count)),
|
||||
[Symbol.iterator]: () => src,
|
||||
|
||||
Reference in new issue
Block a user