We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent c6d5242 commit 1d3ae86Copy full SHA for 1d3ae86
1 file changed
src/vs/base/common/iterator.ts
@@ -56,6 +56,20 @@ export module Iterator {
56
};
57
}
58
59
+ export function fromIterableIterator<T>(it: IterableIterator<T>): Iterator<T> {
60
+ return {
61
+ next(): IteratorResult<T> {
62
+ const result = it.next();
63
+
64
+ if (result.done) {
65
+ return FIN;
66
+ }
67
68
+ return { done: false, value: result.value };
69
70
+ };
71
72
73
export function from<T>(elements: Iterator<T> | T[] | undefined): Iterator<T> {
74
if (!elements) {
75
return Iterator.empty();
0 commit comments