MCPcopy
hub / github.com/vercel/hyper / iteratorToArray

Function iteratorToArray

bin/yarn-standalone.js:8883–8891  ·  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

8881 * @returns {Array} Returns the converted array.
8882 */
8883 function iteratorToArray(iterator) {
8884 var data,
8885 result = [];
8886
8887 while (!(data = iterator.next()).done) {
8888 result.push(data.value);
8889 }
8890 return result;
8891 }
8892
8893 /**
8894 * Converts `map` to its key-value pairs.

Callers 1

toArrayFunction · 0.85

Calls 2

nextMethod · 0.45
pushMethod · 0.45

Tested by

no test coverage detected