Skip to content

Commit

Permalink
Convert nullish values to empty strings.
Browse files Browse the repository at this point in the history
Convert nullish values to empty strings `_serializeValue`.
  • Loading branch information
flatheadmill authored and ralphtheninja committed Sep 4, 2017
1 parent af93dbd commit 2b75f31
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions abstract-leveldown.js
Expand Up @@ -254,9 +254,8 @@ AbstractLevelDOWN.prototype._serializeKey = function (key) {
}

AbstractLevelDOWN.prototype._serializeValue = function (value) {
return this._isBuffer(value) || process.browser || value == null
? value
: String(value)
if (value == null) return ''
return this._isBuffer(value) || process.browser ? value : String(value)
}

AbstractLevelDOWN.prototype._checkKey = function (obj, type) {
Expand Down

0 comments on commit 2b75f31

Please sign in to comment.