-
Notifications
You must be signed in to change notification settings - Fork 0
iteratorutils
Michael Rojas edited this page Jun 24, 2021
·
1 revision
dastal - v5.0.0 / IteratorUtils
▸ always<T>(fn
): Iterator
<T>
Get an iterator that always returns a given value.
Name | Type |
---|---|
T |
T = any
|
Name | Type |
---|---|
fn |
() => T
|
Iterator
<T>
▸ fill<T>(length
, fn
): Iterator
<T>
Get an iterator that returns a value a given amount of times.
Name | Type |
---|---|
T |
T = any
|
Name | Type |
---|---|
length |
number |
fn |
() => T
|
Iterator
<T>
▸ first<T>(n
, iterator
): Iterator
<T>
Iterate through the first num elements of an iterator.
Name | Type |
---|---|
T |
T = any
|
Name | Type | Description |
---|---|---|
n |
number |
The number of elements to iterate. |
iterator |
Iterator <T> |
The iterator. |
Iterator
<T>
- An iterator limited to the next n elements.
▸ join<T>(iterators
): Iterator
<T>
Join multiple iterators into one.
Name | Type |
---|---|
T |
T = any
|
Name | Type | Description |
---|---|---|
iterators |
Iterator <Iterator<T>> |
The iterators to join. |
Iterator
<T>
▸ never<T>(): Iterator
<T>
Get an empty iterator.
Name | Type |
---|---|
T |
T = any
|
Iterator
<T>
▸ once<T>(fn
): Iterator
<T>
Wrap a value in an iterator.
Name | Type |
---|---|
T |
T = any
|
Name | Type |
---|---|
fn |
() => T
|
Iterator
<T>
▸ skip<T>(n
, iterator
): Iterator
<T>
Skip the next num elements of an iterator.
Name | Type |
---|---|
T |
T = any
|
Name | Type | Description |
---|---|---|
n |
number |
The number of elements to skip. |
iterator |
Iterator <T> |
The iterator. |
Iterator
<T>
- The iterator after skipping n elements.
▸ split<T>(length
, iterator
): Iterator
<Iterator<T>>
Split an iterator into multiple iterators of a given length.
Name | Type |
---|---|
T |
T = any
|
Name | Type | Description |
---|---|---|
length |
number |
The length of each iterator. |
iterator |
Iterator <T> |
The iterator to split. |
Iterator
<Iterator<T>>
- An iterator of the resulting iterators.