level-sublevel
Advanced tools
Comparing version 6.5.0 to 6.5.1
@@ -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", |
32
range.js
@@ -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 @@ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
83714
54
2518
+ Addedltgt@2.1.3(transitive)
- Removedltgt@2.0.0(transitive)
Updatedltgt@~2.1.1