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

level-sublevel

Package Overview
Dependencies
Maintainers
1
Versions
102
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

level-sublevel - npm Package Compare versions

Comparing version 4.6.2 to 4.6.3

test/reverse-order.js

1

index.js

@@ -54,3 +54,2 @@ var EventEmitter = require('events').EventEmitter

else opts.end = opts.end || sep
return fun.call(db, opts)

@@ -57,0 +56,0 @@ }

{
"name": "level-sublevel",
"description": "",
"version": "4.6.2",
"version": "4.6.3",
"homepage": "https://github.com/dominictarr/level-sublevel",

@@ -16,6 +16,7 @@ "repository": {

"devDependencies": {
"levelup": "~0.7.0",
"levelup": "~0.8.0",
"rimraf": "~2.1.4",
"tape": "~0.2.2",
"shasum": "0.0.2"
"shasum": "0.0.2",
"monotonic-timestamp": "0.0.8"
},

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

@@ -99,5 +99,6 @@ var EventEmitter = require('events').EventEmitter

//opts.end = p + (opts.end || this._sep)
opts = ranges.prefix(opts, p)
return r.createReadStream(opts)
var _opts = ranges.prefix(opts, p)
_opts.reverse = opts.reverse
return r.createReadStream(_opts)
.on('data', function (d) {

@@ -104,0 +105,0 @@ //mutate the prefix!

@@ -18,3 +18,3 @@ var test = require('tape')

t.plan(10)
t.plan(19)

@@ -29,2 +29,7 @@ var docs = {

function order(a, b) {
t.deepEqual(a, b)
t.equal(JSON.stringify(a), JSON.stringify(b))
}
db.batch(Object.keys(docs).map(function (key) {

@@ -37,7 +42,7 @@ console.log(key, docs[key])

all(db, {}, function (err, all) {
t.deepEqual(all, docs)
order(all, docs)
})
all(db, {min: 'a~'}, function (err, all) {
t.deepEqual(all, {
order(all, {
b: 'banana',

@@ -51,3 +56,3 @@ c: 'cherry',

all(db, {min: 'b'}, function (err, all) {
t.deepEqual(all, {
order(all, {
b: 'banana',

@@ -62,7 +67,7 @@ c: 'cherry',

all(db, {min: 'a~', reverse: true}, function (err, all) {
t.deepEqual(all, {
b: 'banana',
order(all, {
e: 'elder-berry',
d: 'durian',
c: 'cherry',
d: 'durian',
e: 'elder-berry'
b: 'banana'
})

@@ -73,5 +78,5 @@ })

console.log(all)
t.deepEqual(all, {
d: 'durian',
e: 'elder-berry'
order(all, {
e: 'elder-berry',
d: 'durian'
})

@@ -82,3 +87,3 @@ })

console.log(all)
t.deepEqual(all, {
order(all, {
d: 'durian',

@@ -89,3 +94,3 @@ })

all(db, {min: 'a~'}, function (err, all) {
t.deepEqual(all, {
order(all, {
b: 'banana',

@@ -99,4 +104,4 @@ c: 'cherry',

all(db, {min: 'c~'}, function (err, all) {
console.log(all)
t.deepEqual(all, {
console.log('d, e', all)
order(all, {
d: 'durian',

@@ -109,3 +114,3 @@ e: 'elder-berry'

console.log(all)
t.deepEqual(all, {
order(all, {
d: 'durian',

@@ -112,0 +117,0 @@ })

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