Skip to content
This repository has been archived by the owner on Dec 6, 2018. It is now read-only.

Commit

Permalink
update to modern pull-stream api
Browse files Browse the repository at this point in the history
  • Loading branch information
dominictarr committed May 12, 2018
1 parent 3c9fae9 commit b3042c6
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 14 deletions.
28 changes: 17 additions & 11 deletions test/key-value-stream.js
Expand Up @@ -11,25 +11,28 @@ tape('keys', function (t) {

var db = sublevel(level()).sublevel('test')

pull.count(10)
.pipe(pull.map(function (i) {
pull(
pull.count(10),
pull.map(function (i) {
return {key: 'key_'+i, value: 'value_' + i}
}))
.pipe(pl.write(db, function (err) {
}),
pl.write(db, function (err) {
if(err) {
t.notOk(err)
throw err
}

toPull(db.createKeyStream())
.pipe(pull.collect(function (err, ary) {
pull(
toPull(db.createKeyStream()),
pull.collect(function (err, ary) {
console.log(ary)
ary.forEach(function (e) {
t.equal(typeof e, 'string')
t.ok(/^key_/.test(e))
})
toPull(db.createValueStream())
.pipe(pull.collect(function (err, ary) {
pull(
toPull(db.createValueStream()),
pull.collect(function (err, ary) {
console.log(ary)
ary.forEach(function (e) {
t.equal(typeof e, 'string')
Expand All @@ -38,8 +41,11 @@ tape('keys', function (t) {
})

t.end()
}))
}))
}))
})
)
})
)
})
)
})

1 change: 1 addition & 0 deletions test/level.js
Expand Up @@ -217,3 +217,4 @@ codex.forEach(function (codec) {
})

})

3 changes: 0 additions & 3 deletions test/trigger.js

This file was deleted.

0 comments on commit b3042c6

Please sign in to comment.