level-codec
Advanced tools
Comparing version 5.2.0 to 5.3.0
13
index.js
@@ -62,2 +62,15 @@ var encodings = require('./lib/encodings'); | ||
var ltgtKeys = ['lt', 'gt', 'lte', 'gte', 'start', 'end']; | ||
Codec.prototype.encodeLtgt = function(ltgt, opts){ | ||
var self = this; | ||
var ret = {}; | ||
Object.keys(ltgt).forEach(function(key){ | ||
ret[key] = ltgtKeys.indexOf(key) > -1 | ||
? self.encodeKey(ltgt[key], opts) | ||
: ltgt[key] | ||
}); | ||
return ret; | ||
}; | ||
Codec.prototype.keyAsBuffer = function(opts){ | ||
@@ -64,0 +77,0 @@ return this._keyEncoding(opts).buffer; |
{ | ||
"name": "level-codec", | ||
"repository": "Level/codec", | ||
"version": "5.2.0", | ||
"version": "5.3.0", | ||
"description": "Levelup's encoding logic", | ||
@@ -6,0 +6,0 @@ "license": "MIT", |
@@ -34,2 +34,6 @@ | ||
### #encodeLtgt(ltgt[, opts]) | ||
Encode the ltgt values of option object `ltgt` with given `opts`. | ||
### #decodeKey(key[, opts]) | ||
@@ -36,0 +40,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
10397
13
246
79