level-sublevel
Advanced tools
Comparing version 6.3.7 to 6.3.8
{ | ||
"name": "level-sublevel", | ||
"description": "partition levelup databases", | ||
"version": "6.3.7", | ||
"version": "6.3.8", | ||
"homepage": "https://github.com/dominictarr/level-sublevel", | ||
@@ -6,0 +6,0 @@ "repository": { |
@@ -92,2 +92,6 @@ var ltgt = require('ltgt') | ||
r.reverse = !!range.reverse | ||
//if there where no ranges, then then just use a prefix. | ||
if(!r.gte &&!r.lte) return [prefix] | ||
return r | ||
@@ -94,0 +98,0 @@ } |
@@ -1,3 +0,47 @@ | ||
var tape = require('tape') | ||
var levelup = require('level-test')() | ||
var base = require('../')(levelup('test-sublevels', {valueEncoding: 'json'})) | ||
var test = require('tape') | ||
test('subsections', function (t) { | ||
var foo = base.sublevel('foo') | ||
var bar = base.sublevel('bar') | ||
var n, m, o = m = n = 0 | ||
foo.post(function (op) { | ||
n ++ | ||
}) | ||
//this should do the same | ||
foo.post({}, function (op) { | ||
m ++ | ||
}) | ||
foo.post({gte: 'm'}, function (op) { | ||
o ++ | ||
}) | ||
base.batch([ | ||
{ key: 'a', value: 1, type: 'put', prefix: foo }, | ||
{ key: 'k', value: 2, type: 'put', prefix: foo }, | ||
{ key: 'q', value: 3, type: 'put', prefix: foo }, | ||
{ key: 'z', value: 4, type: 'put', prefix: foo }, | ||
//into the main base | ||
{ key: 'b', value: 5, type: 'put'}, | ||
{ key: 'b', value: 5, type: 'put', prefix: bar} | ||
], function (err) { | ||
t.equal(n, 4) | ||
t.equal(m, 4) | ||
t.equal(o, 2) | ||
t.end() | ||
}) | ||
}) | ||
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
2295
76842
50