MCPcopy Create free account
hub / github.com/lodash/lodash / iteratorToArray

Function iteratorToArray

npm-package/_iteratorToArray.js:8–16  ·  view source on GitHub ↗

* Converts `iterator` to an array. * * @private * @param {Object} iterator The iterator to convert. * @returns {Array} Returns the converted array.

(iterator)

Source from the content-addressed store, hash-verified

6 * @returns {Array} Returns the converted array.
7 */
8function 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
18module.exports = iteratorToArray;

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected