From b17e9e775b79d7abfb573b334dabf5396e8f7f16 Mon Sep 17 00:00:00 2001 From: Braydon Fuller Date: Tue, 28 Apr 2015 03:22:12 -0400 Subject: [PATCH] Fixed valueEncoding bug by passing options without array. --- lib/levelup.js | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/lib/levelup.js b/lib/levelup.js index 91e5fe8c..ab830ab9 100644 --- a/lib/levelup.js +++ b/lib/levelup.js @@ -352,37 +352,37 @@ LevelUP.prototype.createReadStream = function (options) { options.valueEncoding = options.valueEncoding if (isDefined(options.start)) - options.start = this._codec.encodeKey(options.start, [options]) + options.start = this._codec.encodeKey(options.start, options) if (isDefined(options.end)) - options.end = this._codec.encodeKey(options.end, [options]) + options.end = this._codec.encodeKey(options.end, options) if (isDefined(options.gte)) - options.gte = this._codec.encodeKey(options.gte, [options]) + options.gte = this._codec.encodeKey(options.gte, options) if (isDefined(options.gt)) - options.gt = this._codec.encodeKey(options.gt, [options]) + options.gt = this._codec.encodeKey(options.gt, options) if (isDefined(options.lte)) - options.lte = this._codec.encodeKey(options.lte, [options]) + options.lte = this._codec.encodeKey(options.lte, options) if (isDefined(options.lt)) - options.lt = this._codec.encodeKey(options.lt, [options]) + options.lt = this._codec.encodeKey(options.lt, options) if ('number' !== typeof options.limit) options.limit = -1 - options.keyAsBuffer = this._codec.keyAsBuffer([options]) - options.valueAsBuffer = this._codec.valueAsBuffer([options]) + options.keyAsBuffer = this._codec.keyAsBuffer(options) + options.valueAsBuffer = this._codec.valueAsBuffer(options) var makeData = options.keys && options.values ? function (key, value) { return { - key: self._codec.decodeKey(key, [options]) - , value: self._codec.decodeValue(value, [options]) + key: self._codec.decodeKey(key, options) + , value: self._codec.decodeValue(value, options) } } : options.keys ? function (key) { - return self._codec.decodeKey(key, [options]) + return self._codec.decodeKey(key, options) } : options.values ? function (_, value) { - return self._codec.decodeValue(value, [options]) + return self._codec.decodeValue(value, options) } : function () {}