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

Commit

Permalink
Fixed valueEncoding bug by passing options without array.
Browse files Browse the repository at this point in the history
  • Loading branch information
Braydon Fuller committed Apr 28, 2015
1 parent 9576842 commit b17e9e7
Showing 1 changed file with 12 additions and 12 deletions.
24 changes: 12 additions & 12 deletions lib/levelup.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 () {}

Expand Down

0 comments on commit b17e9e7

Please sign in to comment.