level-codec
Advanced tools
Comparing version 5.3.0 to 5.4.0
@@ -64,3 +64,3 @@ var encodings = require('./lib/encodings'); | ||
Codec.prototype.encodeLtgt = function(ltgt, opts){ | ||
Codec.prototype.encodeLtgt = function(ltgt){ | ||
var self = this; | ||
@@ -70,3 +70,3 @@ var ret = {}; | ||
ret[key] = ltgtKeys.indexOf(key) > -1 | ||
? self.encodeKey(ltgt[key], opts) | ||
? self.encodeKey(ltgt[key], ltgt) | ||
: ltgt[key] | ||
@@ -73,0 +73,0 @@ }); |
{ | ||
"name": "level-codec", | ||
"repository": "Level/codec", | ||
"version": "5.3.0", | ||
"version": "5.4.0", | ||
"description": "Levelup's encoding logic", | ||
@@ -6,0 +6,0 @@ "license": "MIT", |
@@ -34,5 +34,5 @@ | ||
### #encodeLtgt(ltgt[, opts]) | ||
### #encodeLtgt(ltgt) | ||
Encode the ltgt values of option object `ltgt` with given `opts`. | ||
Encode the ltgt values of option object `ltgt`. | ||
@@ -39,0 +39,0 @@ ### #decodeKey(key[, opts]) |
@@ -5,2 +5,4 @@ var test = require('tape'); | ||
test('encode ltgt', function(t){ | ||
var codec = new Codec({ keyEncoding: 'hex' }); | ||
var ltgt = { | ||
@@ -10,4 +12,2 @@ start: '686579', | ||
}; | ||
var codec = new Codec({ keyEncoding: 'hex' }); | ||
var encoded = codec.encodeLtgt(ltgt); | ||
@@ -17,3 +17,8 @@ t.equal(encoded.start.toString(), 'hey'); | ||
var encoded = codec.encodeLtgt(ltgt, { keyEncoding: 'json' }); | ||
ltgt = { | ||
start: '686579', | ||
lte: '686579', | ||
keyEncoding: 'json' | ||
}; | ||
encoded = codec.encodeLtgt(ltgt); | ||
t.equal(encoded.start, '"686579"'); | ||
@@ -20,0 +25,0 @@ t.equal(encoded.lte, '"686579"'); |
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
11410
14
285