Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

pull-level

Package Overview
Dependencies
Maintainers
1
Versions
30
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

pull-level - npm Package Compare versions

Comparing version 1.0.1 to 1.0.2

2

index.js

@@ -36,3 +36,3 @@

return read(db, opts)
return cat([read(db, opts), live(db, opts) ])
return cat([read(db, opts), live(db, opts)])
}

@@ -39,0 +39,0 @@

{
"name": "pull-level",
"description": "",
"version": "1.0.1",
"description": "pull-stream interface to levelup",
"version": "1.0.2",
"homepage": "https://github.com/dominictarr/pull-level",

@@ -11,7 +11,12 @@ "repository": {

"dependencies": {
"level-fix-range": "~1.1"
"level-fix-range": "~1.1",
"pull-stream": "~2.10",
"pull-pushable": "~1.0.2",
"pull-window": "~1.0.1",
"pull-cat": "~1.0"
},
"devDependencies": {
"monotonic-timestamp": "0.0.8",
"levelup": "git://github.com/dominictarr/node-levelup.git#installable-reverse"
"levelup": "git://github.com/dominictarr/node-levelup.git#installable-reverse",
"level-sublevel": "~4.1.0"
},

@@ -18,0 +23,0 @@ "scripts": {

@@ -48,5 +48,7 @@ var pull = require('pull-stream')

var ts = 0
exports.timestamps = function (db, n, cb) {
var all = []
pull.infinite()
.pipe(pull.take(n))
.pipe(pull.map(function (e) {

@@ -58,3 +60,2 @@ return {

}))
.pipe(pull.take(n))
.pipe(pull.through(function (e) {

@@ -61,0 +62,0 @@ all.push({key:e.key, value: e.value})

@@ -24,27 +24,34 @@

l.read(db, {tail: true})
.pipe(pull.take(20))
.pipe(pull.asyncMap(function (e, cb) {
setTimeout(function () {
cb(null, e)
}, 5)
}))
.pipe(pull.through(function (e) {
console.log(e, i++)
}))
.pipe(function (read) {
return function (abort, cb) {
read(abort, function (end, data) {
cb(end, data)
})
}
})
.pipe(pull.take(20, true))
.pipe(pull.collect(function (err, ary) {
t.notOk(err)
t.ok(second)
t.equal(ary.length, all.length)
t.equal(ary.length, 20)
t.deepEqual(ary, all)
t.deepEqual(ary, h.sort(ary.slice()))
t.end()
process.nextTick(function () {
t.notOk(err)
t.ok(second)
console.log(all)
t.equal(ary.length, 20)
t.equal(ary.length, all.length)
t.deepEqual(ary, h.sort(ary.slice()))
t.deepEqual(ary.map(function (e) {
return {key: e.key, value: e.value}
}), all)
t.end()
})
}))
h.timestamps(db, 10, function (err, _all) {
second = true
all = all.concat(_all)
})
setTimeout(function () {
h.timestamps(db, 10, function (err, _all) {
second = true
all = all.concat(_all)
console.log('all', all, all.length)
})
}, 100)
})
})
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc