UNPKG

@newdash/newdash

Version:

javascript/typescript utility library

19 lines (18 loc) 452 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); /** * Converts `iterator` to an array. * * @private * @param {Object} iterator The iterator to convert. * @returns {Array} Returns the converted array. */ function iteratorToArray(iterator) { let data; const result = []; while (!(data = iterator.next()).done) { result.push(data.value); } return result; } exports.default = iteratorToArray;