Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
Batch.prototype.put = function (key_, value_, options) {
options = getOptions(options)
var key = this._codec.encodeKey(key_, options)
var value = this._codec.encodeValue(value_, options)
try {
this.batch.put(key, value)
} catch (e) {
throw new WriteError(e)
}
this.ops.push({ type: 'put', key: key, value: value })
this.length++
return this
}
Batch.prototype.del = function (key_, options) {
options = getOptions(options)
var key = this._codec.encodeKey(key_, options)
try {
this.batch.del(key)
} catch (err) {
throw new WriteError(err)
}
this.ops.push({ type: 'del', key: key })
this.length++
return this
}