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 6.5.0 to 6.5.1

test/legacy-start-end.js

6

nut.js

@@ -162,3 +162,3 @@ var hooks = require('./hooks')

var opts = clone(_opts || {})
var prefix = opts.prefix || []
var prefix = _opts.prefix || []

@@ -169,4 +169,6 @@ function encodeKey(key) {

ltgt.toLtgt(opts, opts, encodeKey, precodec.lowerBound, precodec.upperBound)
ltgt.toLtgt(_opts, opts, encodeKey, precodec.lowerBound, precodec.upperBound)
// if these legacy values are in the options, remove them
opts.prefix = null

@@ -173,0 +175,0 @@

{
"name": "level-sublevel",
"description": "partition levelup databases",
"version": "6.5.0",
"version": "6.5.1",
"homepage": "https://github.com/dominictarr/level-sublevel",

@@ -12,3 +12,3 @@ "repository": {

"pull-stream": "~2.21.0",
"ltgt": "~2.0.0",
"ltgt": "~2.1.1",
"levelup": "~0.19.0",

@@ -15,0 +15,0 @@ "xtend": "~4.0.0",

@@ -66,34 +66,14 @@ var ltgt = require('ltgt')

// return ltgt.contains(range, key, compare)
if(range.lt && _compare(key, range.lt) >= 0) return false
if(range.lte && _compare(key, range.lte) > 0) return false
if(range.gt && _compare(key, range.gt) <= 0) return false
if(range.gte && _compare(key, range.gte) < 0) return false
return true
return ltgt.contains(range, key, compare)
}
function addPrefix(prefix, range) {
var r = {}
if(has(range, 'lt')) r.lt = [prefix, range.lt]
if(has(range, 'gt')) r.gt = [prefix, range.gt]
if(has(range, 'lte')) r.lte = [prefix, range.lte]
if(has(range, 'gte')) r.gte = [prefix, range.gte]
if(has(range, 'start')) {
if(range.reverse) r.lte = [prefix, range.start]
else r.gte = [prefix, range.start]
}
if(has(range, 'end')) {
if(range.reverse) r.gte = [prefix, range.end]
else r.lte = [prefix, range.end]
}
if(has(range, 'min')) r.gte = [prefix, range.min]
if(has(range, 'max')) r.lte = [prefix, range.max]
r.reverse = !!range.reverse
var o = ltgt.toLtgt(range, null, function (key) {
return [prefix, key]
})
//if there where no ranges, then then just use a prefix.
if(!r.gte &&!r.lte) return [prefix]
if(!has(o, 'gte') && !has(o, 'lte')) return [prefix]
return r
return o
}

@@ -100,0 +80,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