Last change
on this file since eed0bf8 was 6a3a178, checked in by Ema <ema_spirova@…>, 3 years ago |
initial commit
|
-
Property mode
set to
100644
|
File size:
360 bytes
|
Rev | Line | |
---|
[6a3a178] | 1 | /**
|
---|
| 2 | * Converts `iterator` to an array.
|
---|
| 3 | *
|
---|
| 4 | * @private
|
---|
| 5 | * @param {Object} iterator The iterator to convert.
|
---|
| 6 | * @returns {Array} Returns the converted array.
|
---|
| 7 | */
|
---|
| 8 | function iteratorToArray(iterator) {
|
---|
| 9 | var data,
|
---|
| 10 | result = [];
|
---|
| 11 |
|
---|
| 12 | while (!(data = iterator.next()).done) {
|
---|
| 13 | result.push(data.value);
|
---|
| 14 | }
|
---|
| 15 | return result;
|
---|
| 16 | }
|
---|
| 17 |
|
---|
| 18 | module.exports = iteratorToArray;
|
---|
Note:
See
TracBrowser
for help on using the repository browser.