mirror of
https://github.com/DanielnetoDotCom/YouPHPTube
synced 2025-10-03 09:49:28 +02:00
15 lines
372 B
JavaScript
15 lines
372 B
JavaScript
module.exports = function (iterator, cb) {
|
|
var data = []
|
|
var next = function () {
|
|
iterator.next(function (err, key, value) {
|
|
if (err || (key === undefined && value === undefined)) {
|
|
return iterator.end(function (err2) {
|
|
cb(err || err2, data)
|
|
})
|
|
}
|
|
data.push({ key: key, value: value })
|
|
next()
|
|
})
|
|
}
|
|
next()
|
|
}
|