1
0
Fork 0
mirror of https://github.com/DanielnetoDotCom/YouPHPTube synced 2025-10-03 17:59:55 +02:00
Oinktube/node_modules/level-concat-iterator/index.js
2022-07-15 11:08:01 -03:00

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()
}