MCPcopy
hub / github.com/dunky11/react-saas-template / iteratorToArray

Function iteratorToArray

src/shared/functions/toArray.js:224–233  ·  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

222 * @returns {Array} Returns the converted array.
223 */
224function iteratorToArray(iterator) {
225 let data;
226
227 const result = [];
228
229 while (!(data = iterator.next()).done) {
230 result.push(data.value);
231 }
232 return result;
233}
234
235/**
236 * Converts `map` to its key-value pairs.

Callers 1

toArrayFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected