mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-01 15:57:48 +00:00
Bump to v4.0.0.
This commit is contained in:
18
internal/iteratorToArray.js
Normal file
18
internal/iteratorToArray.js
Normal 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;
|
||||
}
|
||||
|
||||
export default iteratorToArray;
|
||||
Reference in New Issue
Block a user