Skip to content
This repository was archived by the owner on Dec 1, 2024. It is now read-only.

Commit b17e9e7

Browse files
author
Braydon Fuller
committed
Fixed valueEncoding bug by passing options without array.
1 parent 9576842 commit b17e9e7

File tree

1 file changed

+12
-12
lines changed

1 file changed

+12
-12
lines changed

lib/levelup.js

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -352,37 +352,37 @@ LevelUP.prototype.createReadStream = function (options) {
352352
options.valueEncoding = options.valueEncoding
353353

354354
if (isDefined(options.start))
355-
options.start = this._codec.encodeKey(options.start, [options])
355+
options.start = this._codec.encodeKey(options.start, options)
356356
if (isDefined(options.end))
357-
options.end = this._codec.encodeKey(options.end, [options])
357+
options.end = this._codec.encodeKey(options.end, options)
358358
if (isDefined(options.gte))
359-
options.gte = this._codec.encodeKey(options.gte, [options])
359+
options.gte = this._codec.encodeKey(options.gte, options)
360360
if (isDefined(options.gt))
361-
options.gt = this._codec.encodeKey(options.gt, [options])
361+
options.gt = this._codec.encodeKey(options.gt, options)
362362
if (isDefined(options.lte))
363-
options.lte = this._codec.encodeKey(options.lte, [options])
363+
options.lte = this._codec.encodeKey(options.lte, options)
364364
if (isDefined(options.lt))
365-
options.lt = this._codec.encodeKey(options.lt, [options])
365+
options.lt = this._codec.encodeKey(options.lt, options)
366366
if ('number' !== typeof options.limit)
367367
options.limit = -1
368368

369-
options.keyAsBuffer = this._codec.keyAsBuffer([options])
370-
options.valueAsBuffer = this._codec.valueAsBuffer([options])
369+
options.keyAsBuffer = this._codec.keyAsBuffer(options)
370+
options.valueAsBuffer = this._codec.valueAsBuffer(options)
371371

372372
var makeData = options.keys && options.values
373373
? function (key, value) {
374374
return {
375-
key: self._codec.decodeKey(key, [options])
376-
, value: self._codec.decodeValue(value, [options])
375+
key: self._codec.decodeKey(key, options)
376+
, value: self._codec.decodeValue(value, options)
377377
}
378378
}
379379
: options.keys
380380
? function (key) {
381-
return self._codec.decodeKey(key, [options])
381+
return self._codec.decodeKey(key, options)
382382
}
383383
: options.values
384384
? function (_, value) {
385-
return self._codec.decodeValue(value, [options])
385+
return self._codec.decodeValue(value, options)
386386
}
387387
: function () {}
388388

0 commit comments

Comments
 (0)