/**
 * Minified by jsDelivr using Terser v5.37.0.
 * Original file: /npm/bdb4.8@0.2.1/index.js
 *
 * Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files
 */
var addon=require("bindings")("addon.node");function decode(t,e={}){return"string"==typeof e&&(e={encoding:e}),(e.encoding||e.json)&&(t=t.toString(e.encoding||"utf8")),e.json&&(t=JSON.parse(t||null)),t}function encode(t,e={}){"string"==typeof e&&(e={encoding:e}),e.json&&(t=JSON.stringify(t));var n=t;return"string"==typeof n&&(n=new Buffer(t,e.encoding||"utf8")),n}function appendTxn(t,e={}){return e.txn?t.concat(e.txn):t}var Db=addon.Db,DbCursor=addon.DbCursor;Db.prototype.put=function(t,e,n={}){return t=t.toString("utf8"),e=encode(e,n),this._put.apply(this,appendTxn([t,e],n))},Db.prototype.del=function(t,e={}){return t=t.toString("utf8"),this._del.apply(this,appendTxn([t],e))},Db.prototype.get=function(t,e={}){return t=t.toString("utf8"),decode(this._get.apply(this,appendTxn([t],e)),e)},DbCursor.prototype.put=function(t,e={}){return t=encode(t,e),this._put(t)},DbCursor.prototype.del=function(){return this._del()},DbCursor.prototype.set=function(t,e={}){return{key:t=t.toString("utf8"),value:decode(this._set(t).value)}},DbCursor.prototype.current=function(t={}){var e=this._current(),n=decode(e.value,t);return{key:e.key?e.key.toString("utf8"):e.key,value:n}},DbCursor.prototype.next=function(t={}){var e=this._next(),n=decode(e.value,t);return{key:e.key?e.key.toString("utf8"):e.key,value:n}},DbCursor.prototype.prev=function(t={}){var e=this._prev(),n=decode(e.value,t);return{key:e.key?e.key.toString("utf8"):e.key,value:n}},DbCursor.prototype.first=function(t={}){var e=this._first(),n=decode(e.value,t);return{key:e.key?e.key.toString("utf8"):e.key,value:n}},DbCursor.prototype.last=function(t={}){var e=this._last(),n=decode(e.value,t);return{key:e.key?e.key.toString("utf8"):e.key,value:n}},module.exports=addon;
//# sourceMappingURL=/sm/10806830ac0010d9c081207b976d0f1ddff83648926148e68cd575aedd889b1d.map