From 565f125e0495ac0d5e2c04d83bab45cd0a81cc6f Mon Sep 17 00:00:00 2001 From: Mathias Buus Date: Sat, 28 May 2016 16:34:17 +0200 Subject: [PATCH] allow empty value in batch --- memdown.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/memdown.js b/memdown.js index e823206..e39962a 100644 --- a/memdown.js +++ b/memdown.js @@ -204,7 +204,8 @@ MemDOWN.prototype._batch = function (array, options, callback) { if (array[i].type === 'put') { value = this._isBuffer(array[i].value) ? array[i].value : String(array[i].value) - err = this._checkKey(value, 'value') + if (value === null || value === undefined) + err = new Error('value cannot be `null` or `undefined`') if (err) return setImmediate(function errorCall() { callback(err) })