Add npm-package

This commit is contained in:
Mathias Bynens
2020-07-08 19:10:23 +02:00
parent 1b6c282299
commit 2e1c0f22f4
1046 changed files with 40050 additions and 0 deletions

View File

@@ -0,0 +1,18 @@
/**
* Converts `iterator` to an array.
*
* @private
* @param {Object} iterator The iterator to convert.
* @returns {Array} Returns the converted array.
*/
function iteratorToArray(iterator) {
var data,
result = [];
while (!(data = iterator.next()).done) {
result.push(data.value);
}
return result;
}
module.exports = iteratorToArray;