subleveldown
Advanced tools
Comparing version 1.0.5 to 1.0.6
{ | ||
"name": "subleveldown", | ||
"version": "1.0.5", | ||
"version": "1.0.6", | ||
"description": "sublevels implemented using leveldowns", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -5,6 +5,7 @@ var util = require('util') | ||
var concat = function(prefix, key, len) { | ||
if (!len) len = key.length | ||
if (typeof key === 'string' && len) return prefix+key | ||
if (Buffer.isBuffer(key) && len) return Buffer.concat([new Buffer(prefix), key]) | ||
var END = new Buffer([0xff]) | ||
var concat = function(prefix, key, force) { | ||
if (typeof key === 'string' && (force || key.length)) return prefix+key | ||
if (Buffer.isBuffer(key) && (force || key.length)) return Buffer.concat([new Buffer(prefix), key]) | ||
return key | ||
@@ -47,6 +48,7 @@ } | ||
gt: function(x) { | ||
return concat(self.prefix, x || '', 1) | ||
return concat(self.prefix, x || '', true) | ||
}, | ||
lt: function(x) { | ||
return concat(self.prefix, x || '\xff', 1) | ||
if (Buffer.isBuffer(x) && !x.length) x = END | ||
return concat(self.prefix, x || '\xff') | ||
} | ||
@@ -53,0 +55,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
11182
233