Constructor
new _Wrapper(optionsopt)
Create a new Wrapped iterable/iterator.
Parameters:
Name | Type | Attributes | Default | Description | ||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
options |
Object |
<optional> |
{} |
Properties
|
Methods
[Symbol.iterator]() → {itbl._Wrapper}
Get an iterator to the wrapped iterable.
By default returns its self but will be overwritten if a [Symbol.iterator] method is passed to the constructor.
Throws:
Throws if the wrapped value is an iterator or an iterable whose [Symbol.iterator] method throws.
Returns:
Returns a wrapped iterator.
- Type
- itbl._Wrapper
next() → {Step}
Get the next value of this iterator.
This method is only defined if the wrapped value is an iterator.
Throws:
Throws if the wrapped iterator's next method throws.
Returns:
Returns the next iterator value.
- Type
- Step
return(value) → {Step}
Returns given value and finishes the iterator.
This method is only defined if the wrapped value is defines a return method
Parameters:
Name | Type | Description |
---|---|---|
value |
* | The value to return |
Throws:
Throws if the wrapped iterator's return method throws.
Returns:
Returns a Step
with a value of value
.
- Type
- Step
throw(exception) → {Step}
The throw() method resumes the execution of a generator by throwing an error into it and returns an object with two properties done and value.
This method is only defined if the wrapped value is an iterator
Parameters:
Name | Type | Description |
---|---|---|
exception |
* | The exception to throw. For debugging purposes, it is useful to make it an |
Throws:
Throws if the wrapped iterator's return method throws, for a generator function this happens if the yield expression is not contained within a try-catch block.
Returns:
Returns the next iterator value.
- Type
- Step