@unction/fromiteratortoarray
v3.1.4
Published
![Tests][BADGE_TRAVIS] ![Stability][BADGE_STABILITY] ![Dependencies][BADGE_DEPENDENCY]
Downloads
366
Readme
@unction/fromIteratorToArray
Map<A, B> => Array<[A, B]>
Takes an Iterator (SetIterator, MapIterator, etc) and turns it into an array.
fromIteratorToArray(new Set([1, 2, 3]).entries()) // [[1, 1], [2, 2], [3, 3]]
fromIteratorToArray(new Map([["aaa", "a"], ["bbb", "b"], ["ccc", "c"]]).entries()) // [["aaa", "a"], ["bbb", "b"], ["ccc", "c"]]