Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

ipfs-repo-migrations

Package Overview
Dependencies
Maintainers
5
Versions
40
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ipfs-repo-migrations - npm Package Compare versions

Comparing version 0.2.0 to 0.2.1

10

CHANGELOG.md

@@ -0,1 +1,11 @@

<a name="0.2.1"></a>
## [0.2.1](https://github.com/ipfs/js-ipfs-repo-migrations/compare/v0.2.0...v0.2.1) (2020-04-28)
### Bug Fixes
* linter ([2a20542](https://github.com/ipfs/js-ipfs-repo-migrations/commit/2a20542))
<a name="0.2.0"></a>

@@ -2,0 +12,0 @@ # [0.2.0](https://github.com/ipfs/js-ipfs-repo-migrations/compare/v0.1.1+migr-7...v0.2.0) (2020-04-14)

2

dist/index.min.js
/*! For license information please see index.min.js.LICENSE.txt */
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.IpfsRepoMigrations=t():e.IpfsRepoMigrations=t()}(window,(function(){return function(e){var t={};function r(n){if(t[n])return t[n].exports;var o=t[n]={i:n,l:!1,exports:{}};return e[n].call(o.exports,o,o.exports,r),o.l=!0,o.exports}return r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)r.d(n,o,function(t){return e[t]}.bind(null,o));return n},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s=8)}([function(e,t,r){"use strict";(function(e){var n=r(13),o=r(14),i=r(15);function s(){return c.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function a(e,t){if(s()<t)throw new RangeError("Invalid typed array length");return c.TYPED_ARRAY_SUPPORT?(e=new Uint8Array(t)).__proto__=c.prototype:(null===e&&(e=new c(t)),e.length=t),e}function c(e,t,r){if(!(c.TYPED_ARRAY_SUPPORT||this instanceof c))return new c(e,t,r);if("number"==typeof e){if("string"==typeof t)throw new Error("If encoding is specified then the first argument must be a string");return p(this,e)}return u(this,e,t,r)}function u(e,t,r,n){if("number"==typeof t)throw new TypeError('"value" argument must not be a number');return"undefined"!=typeof ArrayBuffer&&t instanceof ArrayBuffer?function(e,t,r,n){if(t.byteLength,r<0||t.byteLength<r)throw new RangeError("'offset' is out of bounds");if(t.byteLength<r+(n||0))throw new RangeError("'length' is out of bounds");t=void 0===r&&void 0===n?new Uint8Array(t):void 0===n?new Uint8Array(t,r):new Uint8Array(t,r,n);c.TYPED_ARRAY_SUPPORT?(e=t).__proto__=c.prototype:e=l(e,t);return e}(e,t,r,n):"string"==typeof t?function(e,t,r){"string"==typeof r&&""!==r||(r="utf8");if(!c.isEncoding(r))throw new TypeError('"encoding" must be a valid string encoding');var n=0|g(t,r),o=(e=a(e,n)).write(t,r);o!==n&&(e=e.slice(0,o));return e}(e,t,r):function(e,t){if(c.isBuffer(t)){var r=0|h(t.length);return 0===(e=a(e,r)).length||t.copy(e,0,0,r),e}if(t){if("undefined"!=typeof ArrayBuffer&&t.buffer instanceof ArrayBuffer||"length"in t)return"number"!=typeof t.length||(n=t.length)!=n?a(e,0):l(e,t);if("Buffer"===t.type&&i(t.data))return l(e,t.data)}var n;throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}(e,t)}function f(e){if("number"!=typeof e)throw new TypeError('"size" argument must be a number');if(e<0)throw new RangeError('"size" argument must not be negative')}function p(e,t){if(f(t),e=a(e,t<0?0:0|h(t)),!c.TYPED_ARRAY_SUPPORT)for(var r=0;r<t;++r)e[r]=0;return e}function l(e,t){var r=t.length<0?0:0|h(t.length);e=a(e,r);for(var n=0;n<r;n+=1)e[n]=255&t[n];return e}function h(e){if(e>=s())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+s().toString(16)+" bytes");return 0|e}function g(e,t){if(c.isBuffer(e))return e.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(e)||e instanceof ArrayBuffer))return e.byteLength;"string"!=typeof e&&(e=""+e);var r=e.length;if(0===r)return 0;for(var n=!1;;)switch(t){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":case void 0:return N(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return Y(e).length;default:if(n)return N(e).length;t=(""+t).toLowerCase(),n=!0}}function _(e,t,r){var n=!1;if((void 0===t||t<0)&&(t=0),t>this.length)return"";if((void 0===r||r>this.length)&&(r=this.length),r<=0)return"";if((r>>>=0)<=(t>>>=0))return"";for(e||(e="utf8");;)switch(e){case"hex":return T(this,t,r);case"utf8":case"utf-8":return k(this,t,r);case"ascii":return S(this,t,r);case"latin1":case"binary":return I(this,t,r);case"base64":return R(this,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return O(this,t,r);default:if(n)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),n=!0}}function d(e,t,r){var n=e[t];e[t]=e[r],e[r]=n}function m(e,t,r,n,o){if(0===e.length)return-1;if("string"==typeof r?(n=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),r=+r,isNaN(r)&&(r=o?0:e.length-1),r<0&&(r=e.length+r),r>=e.length){if(o)return-1;r=e.length-1}else if(r<0){if(!o)return-1;r=0}if("string"==typeof t&&(t=c.from(t,n)),c.isBuffer(t))return 0===t.length?-1:y(e,t,r,n,o);if("number"==typeof t)return t&=255,c.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?o?Uint8Array.prototype.indexOf.call(e,t,r):Uint8Array.prototype.lastIndexOf.call(e,t,r):y(e,[t],r,n,o);throw new TypeError("val must be string, number or Buffer")}function y(e,t,r,n,o){var i,s=1,a=e.length,c=t.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(e.length<2||t.length<2)return-1;s=2,a/=2,c/=2,r/=2}function u(e,t){return 1===s?e[t]:e.readUInt16BE(t*s)}if(o){var f=-1;for(i=r;i<a;i++)if(u(e,i)===u(t,-1===f?0:i-f)){if(-1===f&&(f=i),i-f+1===c)return f*s}else-1!==f&&(i-=i-f),f=-1}else for(r+c>a&&(r=a-c),i=r;i>=0;i--){for(var p=!0,l=0;l<c;l++)if(u(e,i+l)!==u(t,l)){p=!1;break}if(p)return i}return-1}function w(e,t,r,n){r=Number(r)||0;var o=e.length-r;n?(n=Number(n))>o&&(n=o):n=o;var i=t.length;if(i%2!=0)throw new TypeError("Invalid hex string");n>i/2&&(n=i/2);for(var s=0;s<n;++s){var a=parseInt(t.substr(2*s,2),16);if(isNaN(a))return s;e[r+s]=a}return s}function v(e,t,r,n){return V(N(t,e.length-r),e,r,n)}function b(e,t,r,n){return V(function(e){for(var t=[],r=0;r<e.length;++r)t.push(255&e.charCodeAt(r));return t}(t),e,r,n)}function E(e,t,r,n){return b(e,t,r,n)}function C(e,t,r,n){return V(Y(t),e,r,n)}function A(e,t,r,n){return V(function(e,t){for(var r,n,o,i=[],s=0;s<e.length&&!((t-=2)<0);++s)r=e.charCodeAt(s),n=r>>8,o=r%256,i.push(o),i.push(n);return i}(t,e.length-r),e,r,n)}function R(e,t,r){return 0===t&&r===e.length?n.fromByteArray(e):n.fromByteArray(e.slice(t,r))}function k(e,t,r){r=Math.min(e.length,r);for(var n=[],o=t;o<r;){var i,s,a,c,u=e[o],f=null,p=u>239?4:u>223?3:u>191?2:1;if(o+p<=r)switch(p){case 1:u<128&&(f=u);break;case 2:128==(192&(i=e[o+1]))&&(c=(31&u)<<6|63&i)>127&&(f=c);break;case 3:i=e[o+1],s=e[o+2],128==(192&i)&&128==(192&s)&&(c=(15&u)<<12|(63&i)<<6|63&s)>2047&&(c<55296||c>57343)&&(f=c);break;case 4:i=e[o+1],s=e[o+2],a=e[o+3],128==(192&i)&&128==(192&s)&&128==(192&a)&&(c=(15&u)<<18|(63&i)<<12|(63&s)<<6|63&a)>65535&&c<1114112&&(f=c)}null===f?(f=65533,p=1):f>65535&&(f-=65536,n.push(f>>>10&1023|55296),f=56320|1023&f),n.push(f),o+=p}return function(e){var t=e.length;if(t<=4096)return String.fromCharCode.apply(String,e);var r="",n=0;for(;n<t;)r+=String.fromCharCode.apply(String,e.slice(n,n+=4096));return r}(n)}t.Buffer=c,t.SlowBuffer=function(e){+e!=e&&(e=0);return c.alloc(+e)},t.INSPECT_MAX_BYTES=50,c.TYPED_ARRAY_SUPPORT=void 0!==e.TYPED_ARRAY_SUPPORT?e.TYPED_ARRAY_SUPPORT:function(){try{var e=new Uint8Array(1);return e.__proto__={__proto__:Uint8Array.prototype,foo:function(){return 42}},42===e.foo()&&"function"==typeof e.subarray&&0===e.subarray(1,1).byteLength}catch(t){return!1}}(),t.kMaxLength=s(),c.poolSize=8192,c._augment=function(e){return e.__proto__=c.prototype,e},c.from=function(e,t,r){return u(null,e,t,r)},c.TYPED_ARRAY_SUPPORT&&(c.prototype.__proto__=Uint8Array.prototype,c.__proto__=Uint8Array,"undefined"!=typeof Symbol&&Symbol.species&&c[Symbol.species]===c&&Object.defineProperty(c,Symbol.species,{value:null,configurable:!0})),c.alloc=function(e,t,r){return function(e,t,r,n){return f(t),t<=0?a(e,t):void 0!==r?"string"==typeof n?a(e,t).fill(r,n):a(e,t).fill(r):a(e,t)}(null,e,t,r)},c.allocUnsafe=function(e){return p(null,e)},c.allocUnsafeSlow=function(e){return p(null,e)},c.isBuffer=function(e){return!(null==e||!e._isBuffer)},c.compare=function(e,t){if(!c.isBuffer(e)||!c.isBuffer(t))throw new TypeError("Arguments must be Buffers");if(e===t)return 0;for(var r=e.length,n=t.length,o=0,i=Math.min(r,n);o<i;++o)if(e[o]!==t[o]){r=e[o],n=t[o];break}return r<n?-1:n<r?1:0},c.isEncoding=function(e){switch(String(e).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},c.concat=function(e,t){if(!i(e))throw new TypeError('"list" argument must be an Array of Buffers');if(0===e.length)return c.alloc(0);var r;if(void 0===t)for(t=0,r=0;r<e.length;++r)t+=e[r].length;var n=c.allocUnsafe(t),o=0;for(r=0;r<e.length;++r){var s=e[r];if(!c.isBuffer(s))throw new TypeError('"list" argument must be an Array of Buffers');s.copy(n,o),o+=s.length}return n},c.byteLength=g,c.prototype._isBuffer=!0,c.prototype.swap16=function(){var e=this.length;if(e%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var t=0;t<e;t+=2)d(this,t,t+1);return this},c.prototype.swap32=function(){var e=this.length;if(e%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var t=0;t<e;t+=4)d(this,t,t+3),d(this,t+1,t+2);return this},c.prototype.swap64=function(){var e=this.length;if(e%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var t=0;t<e;t+=8)d(this,t,t+7),d(this,t+1,t+6),d(this,t+2,t+5),d(this,t+3,t+4);return this},c.prototype.toString=function(){var e=0|this.length;return 0===e?"":0===arguments.length?k(this,0,e):_.apply(this,arguments)},c.prototype.equals=function(e){if(!c.isBuffer(e))throw new TypeError("Argument must be a Buffer");return this===e||0===c.compare(this,e)},c.prototype.inspect=function(){var e="",r=t.INSPECT_MAX_BYTES;return this.length>0&&(e=this.toString("hex",0,r).match(/.{2}/g).join(" "),this.length>r&&(e+=" ... ")),"<Buffer "+e+">"},c.prototype.compare=function(e,t,r,n,o){if(!c.isBuffer(e))throw new TypeError("Argument must be a Buffer");if(void 0===t&&(t=0),void 0===r&&(r=e?e.length:0),void 0===n&&(n=0),void 0===o&&(o=this.length),t<0||r>e.length||n<0||o>this.length)throw new RangeError("out of range index");if(n>=o&&t>=r)return 0;if(n>=o)return-1;if(t>=r)return 1;if(this===e)return 0;for(var i=(o>>>=0)-(n>>>=0),s=(r>>>=0)-(t>>>=0),a=Math.min(i,s),u=this.slice(n,o),f=e.slice(t,r),p=0;p<a;++p)if(u[p]!==f[p]){i=u[p],s=f[p];break}return i<s?-1:s<i?1:0},c.prototype.includes=function(e,t,r){return-1!==this.indexOf(e,t,r)},c.prototype.indexOf=function(e,t,r){return m(this,e,t,r,!0)},c.prototype.lastIndexOf=function(e,t,r){return m(this,e,t,r,!1)},c.prototype.write=function(e,t,r,n){if(void 0===t)n="utf8",r=this.length,t=0;else if(void 0===r&&"string"==typeof t)n=t,r=this.length,t=0;else{if(!isFinite(t))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");t|=0,isFinite(r)?(r|=0,void 0===n&&(n="utf8")):(n=r,r=void 0)}var o=this.length-t;if((void 0===r||r>o)&&(r=o),e.length>0&&(r<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");for(var i=!1;;)switch(n){case"hex":return w(this,e,t,r);case"utf8":case"utf-8":return v(this,e,t,r);case"ascii":return b(this,e,t,r);case"latin1":case"binary":return E(this,e,t,r);case"base64":return C(this,e,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return A(this,e,t,r);default:if(i)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),i=!0}},c.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function S(e,t,r){var n="";r=Math.min(e.length,r);for(var o=t;o<r;++o)n+=String.fromCharCode(127&e[o]);return n}function I(e,t,r){var n="";r=Math.min(e.length,r);for(var o=t;o<r;++o)n+=String.fromCharCode(e[o]);return n}function T(e,t,r){var n=e.length;(!t||t<0)&&(t=0),(!r||r<0||r>n)&&(r=n);for(var o="",i=t;i<r;++i)o+=j(e[i]);return o}function O(e,t,r){for(var n=e.slice(t,r),o="",i=0;i<n.length;i+=2)o+=String.fromCharCode(n[i]+256*n[i+1]);return o}function P(e,t,r){if(e%1!=0||e<0)throw new RangeError("offset is not uint");if(e+t>r)throw new RangeError("Trying to access beyond buffer length")}function x(e,t,r,n,o,i){if(!c.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>o||t<i)throw new RangeError('"value" argument is out of bounds');if(r+n>e.length)throw new RangeError("Index out of range")}function D(e,t,r,n){t<0&&(t=65535+t+1);for(var o=0,i=Math.min(e.length-r,2);o<i;++o)e[r+o]=(t&255<<8*(n?o:1-o))>>>8*(n?o:1-o)}function F(e,t,r,n){t<0&&(t=4294967295+t+1);for(var o=0,i=Math.min(e.length-r,4);o<i;++o)e[r+o]=t>>>8*(n?o:3-o)&255}function U(e,t,r,n,o,i){if(r+n>e.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function B(e,t,r,n,i){return i||U(e,0,r,4),o.write(e,t,r,n,23,4),r+4}function L(e,t,r,n,i){return i||U(e,0,r,8),o.write(e,t,r,n,52,8),r+8}c.prototype.slice=function(e,t){var r,n=this.length;if((e=~~e)<0?(e+=n)<0&&(e=0):e>n&&(e=n),(t=void 0===t?n:~~t)<0?(t+=n)<0&&(t=0):t>n&&(t=n),t<e&&(t=e),c.TYPED_ARRAY_SUPPORT)(r=this.subarray(e,t)).__proto__=c.prototype;else{var o=t-e;r=new c(o,void 0);for(var i=0;i<o;++i)r[i]=this[i+e]}return r},c.prototype.readUIntLE=function(e,t,r){e|=0,t|=0,r||P(e,t,this.length);for(var n=this[e],o=1,i=0;++i<t&&(o*=256);)n+=this[e+i]*o;return n},c.prototype.readUIntBE=function(e,t,r){e|=0,t|=0,r||P(e,t,this.length);for(var n=this[e+--t],o=1;t>0&&(o*=256);)n+=this[e+--t]*o;return n},c.prototype.readUInt8=function(e,t){return t||P(e,1,this.length),this[e]},c.prototype.readUInt16LE=function(e,t){return t||P(e,2,this.length),this[e]|this[e+1]<<8},c.prototype.readUInt16BE=function(e,t){return t||P(e,2,this.length),this[e]<<8|this[e+1]},c.prototype.readUInt32LE=function(e,t){return t||P(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},c.prototype.readUInt32BE=function(e,t){return t||P(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},c.prototype.readIntLE=function(e,t,r){e|=0,t|=0,r||P(e,t,this.length);for(var n=this[e],o=1,i=0;++i<t&&(o*=256);)n+=this[e+i]*o;return n>=(o*=128)&&(n-=Math.pow(2,8*t)),n},c.prototype.readIntBE=function(e,t,r){e|=0,t|=0,r||P(e,t,this.length);for(var n=t,o=1,i=this[e+--n];n>0&&(o*=256);)i+=this[e+--n]*o;return i>=(o*=128)&&(i-=Math.pow(2,8*t)),i},c.prototype.readInt8=function(e,t){return t||P(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},c.prototype.readInt16LE=function(e,t){t||P(e,2,this.length);var r=this[e]|this[e+1]<<8;return 32768&r?4294901760|r:r},c.prototype.readInt16BE=function(e,t){t||P(e,2,this.length);var r=this[e+1]|this[e]<<8;return 32768&r?4294901760|r:r},c.prototype.readInt32LE=function(e,t){return t||P(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},c.prototype.readInt32BE=function(e,t){return t||P(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},c.prototype.readFloatLE=function(e,t){return t||P(e,4,this.length),o.read(this,e,!0,23,4)},c.prototype.readFloatBE=function(e,t){return t||P(e,4,this.length),o.read(this,e,!1,23,4)},c.prototype.readDoubleLE=function(e,t){return t||P(e,8,this.length),o.read(this,e,!0,52,8)},c.prototype.readDoubleBE=function(e,t){return t||P(e,8,this.length),o.read(this,e,!1,52,8)},c.prototype.writeUIntLE=function(e,t,r,n){(e=+e,t|=0,r|=0,n)||x(this,e,t,r,Math.pow(2,8*r)-1,0);var o=1,i=0;for(this[t]=255&e;++i<r&&(o*=256);)this[t+i]=e/o&255;return t+r},c.prototype.writeUIntBE=function(e,t,r,n){(e=+e,t|=0,r|=0,n)||x(this,e,t,r,Math.pow(2,8*r)-1,0);var o=r-1,i=1;for(this[t+o]=255&e;--o>=0&&(i*=256);)this[t+o]=e/i&255;return t+r},c.prototype.writeUInt8=function(e,t,r){return e=+e,t|=0,r||x(this,e,t,1,255,0),c.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),this[t]=255&e,t+1},c.prototype.writeUInt16LE=function(e,t,r){return e=+e,t|=0,r||x(this,e,t,2,65535,0),c.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):D(this,e,t,!0),t+2},c.prototype.writeUInt16BE=function(e,t,r){return e=+e,t|=0,r||x(this,e,t,2,65535,0),c.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):D(this,e,t,!1),t+2},c.prototype.writeUInt32LE=function(e,t,r){return e=+e,t|=0,r||x(this,e,t,4,4294967295,0),c.TYPED_ARRAY_SUPPORT?(this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e):F(this,e,t,!0),t+4},c.prototype.writeUInt32BE=function(e,t,r){return e=+e,t|=0,r||x(this,e,t,4,4294967295,0),c.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):F(this,e,t,!1),t+4},c.prototype.writeIntLE=function(e,t,r,n){if(e=+e,t|=0,!n){var o=Math.pow(2,8*r-1);x(this,e,t,r,o-1,-o)}var i=0,s=1,a=0;for(this[t]=255&e;++i<r&&(s*=256);)e<0&&0===a&&0!==this[t+i-1]&&(a=1),this[t+i]=(e/s>>0)-a&255;return t+r},c.prototype.writeIntBE=function(e,t,r,n){if(e=+e,t|=0,!n){var o=Math.pow(2,8*r-1);x(this,e,t,r,o-1,-o)}var i=r-1,s=1,a=0;for(this[t+i]=255&e;--i>=0&&(s*=256);)e<0&&0===a&&0!==this[t+i+1]&&(a=1),this[t+i]=(e/s>>0)-a&255;return t+r},c.prototype.writeInt8=function(e,t,r){return e=+e,t|=0,r||x(this,e,t,1,127,-128),c.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),e<0&&(e=255+e+1),this[t]=255&e,t+1},c.prototype.writeInt16LE=function(e,t,r){return e=+e,t|=0,r||x(this,e,t,2,32767,-32768),c.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):D(this,e,t,!0),t+2},c.prototype.writeInt16BE=function(e,t,r){return e=+e,t|=0,r||x(this,e,t,2,32767,-32768),c.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):D(this,e,t,!1),t+2},c.prototype.writeInt32LE=function(e,t,r){return e=+e,t|=0,r||x(this,e,t,4,2147483647,-2147483648),c.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24):F(this,e,t,!0),t+4},c.prototype.writeInt32BE=function(e,t,r){return e=+e,t|=0,r||x(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),c.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):F(this,e,t,!1),t+4},c.prototype.writeFloatLE=function(e,t,r){return B(this,e,t,!0,r)},c.prototype.writeFloatBE=function(e,t,r){return B(this,e,t,!1,r)},c.prototype.writeDoubleLE=function(e,t,r){return L(this,e,t,!0,r)},c.prototype.writeDoubleBE=function(e,t,r){return L(this,e,t,!1,r)},c.prototype.copy=function(e,t,r,n){if(r||(r=0),n||0===n||(n=this.length),t>=e.length&&(t=e.length),t||(t=0),n>0&&n<r&&(n=r),n===r)return 0;if(0===e.length||0===this.length)return 0;if(t<0)throw new RangeError("targetStart out of bounds");if(r<0||r>=this.length)throw new RangeError("sourceStart out of bounds");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),e.length-t<n-r&&(n=e.length-t+r);var o,i=n-r;if(this===e&&r<t&&t<n)for(o=i-1;o>=0;--o)e[o+t]=this[o+r];else if(i<1e3||!c.TYPED_ARRAY_SUPPORT)for(o=0;o<i;++o)e[o+t]=this[o+r];else Uint8Array.prototype.set.call(e,this.subarray(r,r+i),t);return i},c.prototype.fill=function(e,t,r,n){if("string"==typeof e){if("string"==typeof t?(n=t,t=0,r=this.length):"string"==typeof r&&(n=r,r=this.length),1===e.length){var o=e.charCodeAt(0);o<256&&(e=o)}if(void 0!==n&&"string"!=typeof n)throw new TypeError("encoding must be a string");if("string"==typeof n&&!c.isEncoding(n))throw new TypeError("Unknown encoding: "+n)}else"number"==typeof e&&(e&=255);if(t<0||this.length<t||this.length<r)throw new RangeError("Out of range index");if(r<=t)return this;var i;if(t>>>=0,r=void 0===r?this.length:r>>>0,e||(e=0),"number"==typeof e)for(i=t;i<r;++i)this[i]=e;else{var s=c.isBuffer(e)?e:N(new c(e,n).toString()),a=s.length;for(i=0;i<r-t;++i)this[i+t]=s[i%a]}return this};var M=/[^+\/0-9A-Za-z-_]/g;function j(e){return e<16?"0"+e.toString(16):e.toString(16)}function N(e,t){var r;t=t||1/0;for(var n=e.length,o=null,i=[],s=0;s<n;++s){if((r=e.charCodeAt(s))>55295&&r<57344){if(!o){if(r>56319){(t-=3)>-1&&i.push(239,191,189);continue}if(s+1===n){(t-=3)>-1&&i.push(239,191,189);continue}o=r;continue}if(r<56320){(t-=3)>-1&&i.push(239,191,189),o=r;continue}r=65536+(o-55296<<10|r-56320)}else o&&(t-=3)>-1&&i.push(239,191,189);if(o=null,r<128){if((t-=1)<0)break;i.push(r)}else if(r<2048){if((t-=2)<0)break;i.push(r>>6|192,63&r|128)}else if(r<65536){if((t-=3)<0)break;i.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;i.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return i}function Y(e){return n.toByteArray(function(e){if((e=function(e){return e.trim?e.trim():e.replace(/^\s+|\s+$/g,"")}(e).replace(M,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function V(e,t,r,n){for(var o=0;o<n&&!(o+r>=t.length||o>=e.length);++o)t[o+r]=e[o];return o}}).call(this,r(12))},function(e,t,r){"use strict";const n=r(5),o=r(21),i=r(6),s=r(7);t.Key=n,t.MemoryDatastore=o,t.utils=i,t.Errors=s},function(e,t,r){"use strict";(function(n){t.log=function(...e){return"object"==typeof console&&console.log&&console.log(...e)},t.formatArgs=function(t){if(t[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+t[0]+(this.useColors?"%c ":" ")+"+"+e.exports.humanize(this.diff),!this.useColors)return;const r="color: "+this.color;t.splice(1,0,r,"color: inherit");let n=0,o=0;t[0].replace(/%[a-zA-Z%]/g,e=>{"%%"!==e&&(n++,"%c"===e&&(o=n))}),t.splice(o,0,r)},t.save=function(e){try{e?t.storage.setItem("debug",e):t.storage.removeItem("debug")}catch(r){}},t.load=function(){let e;try{e=t.storage.getItem("debug")}catch(r){}!e&&void 0!==n&&"env"in n&&(e={npm_config_save_dev:"",npm_config_legacy_bundling:"",npm_config_dry_run:"",npm_package_engines_npm:">=6.0.0",npm_config_viewer:"man",npm_config_only:"",npm_config_commit_hooks:"true",npm_config_browser:"",npm_package_gitHead:"dabab4e36fca2110cc4f515821da2eb9a5d43fb7",npm_config_also:"",npm_package_dependencies_datastore_fs:"~0.9.1",npm_config_sign_git_commit:"",npm_config_rollback:"true",TERM_PROGRAM:"vscode",NODE:"/Users/hugomrdias/n/bin/node",npm_config_usage:"",npm_config_audit:"true",INIT_CWD:"/Users/hugomrdias/code/pl/js-ipfs-repo-migrations",npm_package_devDependencies_sinon:"^7.5.0",npm_package_homepage:"https://github.com/ipfs/js-ipfs-repo-migrations",npm_config_globalignorefile:"/Users/hugomrdias/n/etc/npmignore",TERM:"xterm-256color",SHELL:"/usr/local/bin/zsh",npm_config_shell:"/usr/local/bin/zsh",npm_config_maxsockets:"50",npm_config_init_author_url:"",npm_package_devDependencies_rimraf:"^3.0.0",npm_config_shrinkwrap:"true",npm_config_parseable:"",npm_config_metrics_registry:"https://registry.npmjs.org/",TMPDIR:"/var/folders/q9/wc5vzv2n1z310y7_l9kxmynh0000gn/T/",npm_config_timing:"",npm_config_init_license:"ISC",npm_package_scripts_release:"aegir release --docs",npm_package_scripts_lint:"aegir lint",npm_config_if_present:"",npm_package_dependencies_debug:"^4.1.0",TERM_PROGRAM_VERSION:"1.44.0",npm_config_sign_git_tag:"",npm_config_init_author_email:"",npm_config_cache_max:"Infinity",npm_package_devDependencies_aegir:"^21.4.5",npm_config_preid:"",npm_config_long:"",npm_config_local_address:"",npm_config_git_tag_version:"true",npm_config_cert:"",TERM_SESSION_ID:"w0t0p0:1DF980F6-41B2-4559-98C3-5CDC112A6D97",npm_config_registry:"https://registry.npmjs.org/",npm_config_noproxy:"",npm_config_fetch_retries:"2",npm_package_repository_url:"git+https://github.com/ipfs/js-ipfs-repo-migrations.git",ZSH:"/Users/hugomrdias/.oh-my-zsh",npm_config_versions:"",npm_config_message:"%s",npm_config_key:"",npm_package_readmeFilename:"README.md",npm_package_description:"Migration framework for versioning of JS IPFS Repo",USER:"hugomrdias",NVM_DIR:"/Users/hugomrdias/.nvm",N_PREFIX:"/Users/hugomrdias/n",npm_package_license:"MIT",npm_config_globalconfig:"/Users/hugomrdias/n/etc/npmrc",npm_config_prefer_online:"",npm_config_logs_max:"10",npm_config_always_auth:"",npm_package_scripts_test_node:"aegir test --target node",SSH_AUTH_SOCK:"/private/tmp/com.apple.launchd.EVUVYqPELq/Listeners",npm_package_dependencies_buffer:"^5.5.0",__CF_USER_TEXT_ENCODING:"0x1F5:0x0:0x0",npm_execpath:"/Users/hugomrdias/n/lib/node_modules/npm/bin/npm-cli.js",npm_config_global_style:"",npm_config_cache_lock_retries:"10",npm_package_scripts_coverage:"aegir coverage",npm_config_update_notifier:"true",npm_config_cafile:"",FZF_DEFAULT_OPTS:"--bind='ctrl-o:execute(code {})+abort'",PAGER:"less",VIRTUAL_ENV_DISABLE_PROMPT:"12",npm_config_heading:"npm",npm_config_audit_level:"low",LSCOLORS:"Gxfxcxdxbxegedabagacad",npm_config_searchlimit:"20",npm_config_read_only:"",npm_config_offline:"",npm_config_fetch_retry_mintimeout:"10000",npm_package_dependencies_interface_datastore:"~0.8.3",npm_config_json:"",npm_config_access:"",npm_config_argv:'{"remain":[],"cooked":["run","release-minor"],"original":["run","release-minor"]}',AEGIR_GHTOKEN:"981983bbbc2ca7e6e69ab0ba31d03c93f0a331f9",PATH:"/Users/hugomrdias/code/pl/js-ipfs-repo-migrations/node_modules/aegir/node_modules/.bin:/Users/hugomrdias/code/pl/js-ipfs-repo-migrations/node_modules/node_modules/.bin:/Users/hugomrdias/code/pl/js-ipfs-repo-migrations/node_modules/.bin:/Users/hugomrdias/code/pl/node_modules/.bin:/Users/hugomrdias/code/node_modules/.bin:/Users/hugomrdias/node_modules/.bin:/Users/node_modules/.bin:/node_modules/.bin:/Users/hugomrdias/n/bin:/Users/hugomrdias/n/lib/node_modules/npm/node_modules/npm-lifecycle/node-gyp-bin:/Users/hugomrdias/code/pl/js-ipfs-repo-migrations/node_modules/.bin:/Users/hugomrdias/n/bin:/usr/local/opt/openssl/bin:/usr/local/sbin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:~/bin",npm_config_allow_same_version:"",npm_package_contributors_1_email:"hello@adam-uhlir.me",npm_config_https_proxy:"",npm_config_engine_strict:"",npm_config_description:"true",_:"/Users/hugomrdias/code/pl/js-ipfs-repo-migrations/node_modules/.bin/aegir",LaunchInstanceID:"BF153338-6DC4-49D0-94E9-B43421ED836B",npm_config_userconfig:"/Users/hugomrdias/.npmrc",npm_config_init_module:"/Users/hugomrdias/.npm-init.js",npm_config_cidr:"",npm_package_dependencies_yargs:"^14.2.0",PWD:"/Users/hugomrdias/code/pl/js-ipfs-repo-migrations",npm_config_user:"501",npm_config_node_version:"12.16.1",npm_package_bugs_url:"https://github.com/ipfs/js-ipfs-repo-migrations/issues/",npm_lifecycle_event:"release-minor",npm_package_devDependencies_chai:"^4.2.0",npm_package_scripts_release_major:"aegir release --type major --docs",EDITOR:"code",npm_config_save:"true",npm_config_ignore_prepublish:"",npm_config_editor:"code",npm_config_auth_type:"legacy",npm_package_repository_type:"git",npm_package_keywords_0:"IPFS",npm_package_name:"ipfs-repo-migrations",LANG:"en_GB.UTF-8",npm_config_tag:"latest",npm_config_script_shell:"",npm_package_browser___src_repo_lock_js:"./src/repo/lock-memory.js",npm_package_keywords_1:"libp2p",ITERM_PROFILE:"Default",npm_config_progress:"true",npm_config_global:"",npm_config_before:"",npm_package_scripts_build:"aegir build",npm_package_keywords_2:"migrations",npm_config_searchstaleness:"900",npm_config_optional:"true",npm_config_ham_it_up:"",npm_package_contributors_0_email:"adam@uhlir.dev",npm_package_scripts_docs:"aegir docs",XPC_FLAGS:"0x0",npm_config_save_prod:"",npm_config_force:"",npm_config_bin_links:"true",npm_package_scripts_coverage_publish:"aegir-coverage --provider coveralls",npm_package_bin_jsipfs_migrations:"src/cli.js",npm_config_searchopts:"",npm_package_engines_node:">=10.0.0",npm_config_node_gyp:"/Users/hugomrdias/n/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js",npm_config_depth:"Infinity",npm_package_main:"src/index.js",npm_config_sso_poll_frequency:"500",npm_config_rebuild_bundle:"true",npm_package_version:"0.1.1",XPC_SERVICE_NAME:"0",npm_config_unicode:"true",SHLVL:"4",COLORFGBG:"15;0",HOME:"/Users/hugomrdias",npm_config_fetch_retry_maxtimeout:"60000",npm_package_scripts_test:"aegir test",APPLICATION_INSIGHTS_NO_DIAGNOSTIC_CHANNEL:"true",npm_config_tag_version_prefix:"v",npm_config_strict_ssl:"true",npm_config_sso_type:"oauth",npm_config_scripts_prepend_node_path:"warn-only",npm_config_save_prefix:"^",npm_config_loglevel:"notice",npm_config_ca:"",npm_package_devDependencies_ncp:"^2.0.0",npm_package_devDependencies_just_safe_set:"^2.1.0",LC_TERMINAL_VERSION:"3.3.9",npm_config_save_exact:"",npm_config_group:"20",npm_config_fetch_retry_factor:"10",npm_config_dev:"",npm_config_version:"",npm_config_prefer_offline:"",npm_config_cache_lock_stale:"60000",npm_package_browser_datastore_fs:"datastore-idb",npm_config_otp:"",npm_config_cache_min:"10",npm_package_dependencies_chalk:"^4.0.0",ITERM_SESSION_ID:"w0t0p0:1DF980F6-41B2-4559-98C3-5CDC112A6D97",npm_config_searchexclude:"",npm_config_cache:"/Users/hugomrdias/.npm",LOGNAME:"hugomrdias",LESS:"-R",npm_lifecycle_script:"aegir release --type minor --docs",npm_config_color:"true",npm_package_devDependencies_chai_as_promised:"^7.1.1",npm_config_proxy:"",npm_config_package_lock:"true",npm_package_dependencies_proper_lockfile:"^4.1.1",LC_CTYPE:"UTF-8",npm_config_package_lock_only:"",npm_config_fund:"true",FZF_DEFAULT_COMMAND:"fd --type f --hidden --follow --exclude .git",npm_config_save_optional:"",npm_package_scripts_test_browser:"aegir test --target browser",npm_config_ignore_scripts:"",npm_config_user_agent:"npm/6.13.4 node/v12.16.1 darwin x64",npm_package_devDependencies_dirty_chai:"^2.0.1",npm_config_cache_lock_wait:"10000",npm_package_files_2:"dist",PROMPT_EOL_MARK:"",npm_config_production:"",npm_package_dependencies_datastore_idb:"^1.0.0",npm_package_files_1:"src",LC_TERMINAL:"iTerm2",npm_config_send_metrics:"",npm_config_save_bundle:"",npm_package_files_0:"migrations",npm_config_umask:"0022",npm_config_node_options:"",npm_config_init_version:"1.0.0",npm_package_contributors_0_name:"Adam Uhlíř",npm_config_init_author_name:"",npm_config_git:"git",npm_config_scope:"",npm_package_scripts_new_migration:"./src/cli.js add",SECURITYSESSIONID:"186a6",npm_config_unsafe_perm:"true",npm_config_tmp:"/var/folders/q9/wc5vzv2n1z310y7_l9kxmynh0000gn/T",npm_config_onload_script:"",npm_node_execpath:"/Users/hugomrdias/n/bin/node",npm_config_prefix:"/Users/hugomrdias/n",npm_config_link:"",npm_config_format_package_lock:"true",npm_package_contributors_1_name:"Adam Uhlíř",npm_package_dependencies_yargs_promise:"^1.1.0",npm_package_scripts_release_minor:"aegir release --type minor --docs",COLORTERM:"truecolor",NODE_ENV:"production"}.DEBUG);return e},t.useColors=function(){if("undefined"!=typeof window&&window.process&&("renderer"===window.process.type||window.process.__nwjs))return!0;if("undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))return!1;return"undefined"!=typeof document&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||"undefined"!=typeof window&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)},t.storage=function(){try{return localStorage}catch(e){}}(),t.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"],e.exports=r(26)(t);const{formatters:o}=e.exports;o.j=function(e){try{return JSON.stringify(e)}catch(t){return"[UnexpectedJSONParseError]: "+t.message}}}).call(this,r(25))},function(e,t,r){"use strict";class n extends Error{constructor(e){super(e),this.name="NonReversibleMigrationError",this.code="ERR_NON_REVERSIBLE_MIGRATION",this.message=e}}n.code="ERR_NON_REVERSIBLE_MIGRATION",t.NonReversibleMigrationError=n;class o extends Error{constructor(e){super(e),this.name="NotInitializedRepoError",this.code="ERR_NOT_INITIALIZED_REPO",this.message=e}}o.code="ERR_NOT_INITIALIZED_REPO",t.NotInitializedRepoError=o;class i extends Error{constructor(e){super(e),this.name="RequiredParameterError",this.code="ERR_REQUIRED_PARAMETER",this.message=e}}i.code="ERR_REQUIRED_PARAMETER",t.RequiredParameterError=i;class s extends Error{constructor(e){super(e),this.name="InvalidValueError",this.code="ERR_INVALID_VALUE",this.message=e}}s.code="ERR_INVALID_VALUE",t.InvalidValueError=s},function(e,t,r){"use strict";function n(e){return new i(e)}function o(e){var t,r;function n(t,r){try{var s=e[t](r),a=s.value,c=a instanceof i;Promise.resolve(c?a.wrapped:a).then((function(e){c?n("return"===t?"return":"next",e):o(s.done?"return":"normal",e)}),(function(e){n("throw",e)}))}catch(u){o("throw",u)}}function o(e,o){switch(e){case"return":t.resolve({value:o,done:!0});break;case"throw":t.reject(o);break;default:t.resolve({value:o,done:!1})}(t=t.next)?n(t.key,t.arg):r=null}this._invoke=function(e,o){return new Promise((function(i,s){var a={key:e,arg:o,resolve:i,reject:s,next:null};r?r=r.next=a:(t=r=a,n(e,o))}))},"function"!=typeof e.return&&(this.return=void 0)}function i(e){this.wrapped=e}"function"==typeof Symbol&&Symbol.asyncIterator&&(o.prototype[Symbol.asyncIterator]=function(){return this}),o.prototype.next=function(e){return this._invoke("next",e)},o.prototype.throw=function(e){return this._invoke("throw",e)},o.prototype.return=function(e){return this._invoke("return",e)};const{Buffer:s}=r(0),{openDB:a,deleteDB:c}=r(17),{Key:u,Errors:f,utils:p}=r(1),{filter:l,sortAll:h}=p,g=e=>{if((e=>e instanceof Int8Array||e instanceof Int16Array||e instanceof Int32Array||e instanceof Uint8Array||e instanceof Uint8ClampedArray||e instanceof Uint16Array||e instanceof Uint32Array||e instanceof Float32Array||e instanceof Float64Array)(e)){let t=s.from(e.buffer);return e.byteLength!==e.buffer.byteLength&&(t=t.slice(e.byteOffset,e.byteOffset+e.byteLength)),t}return s.from(e)},_=e=>{const t=new ArrayBuffer(e.length),r=new Uint8Array(t);for(let n=0,o=e.length;n<o;n++)r[n]=e.charCodeAt(n);return t},d=function(){var e,t=(e=function*(e,t,r){const o=e.prefix?self.IDBKeyRange.bound(_(e.prefix),_(e.prefix+"ÿ"),!1,!0):void 0;let i=yield n(t.transaction(r).store.openCursor(o)),a=0;for(i&&e.offset&&e.offset>0&&(i=yield n(i.advance(e.offset)));i;){if(void 0!==e.limit&&e.limit===a)return;a++;const t=new u(s.from(i.key));if(e.keysOnly)yield{key:t};else{const e=s.from(i.value);yield{key:t,value:e}}i=yield n(i.continue())}},function(){return new o(e.apply(this,arguments))});return function(e,r,n){return t.apply(this,arguments)}}();e.exports=class{constructor(e,t={}){this.store=null,this.options=t,this.location=t.prefix+e,this.version=t.version||1}async open(){const e=this.location;try{this.store=await a(this.location,this.version,{upgrade(t){t.createObjectStore(e)}})}catch(t){throw f.dbOpenFailedError(t)}}async put(e,t){if(null===this.store)throw new Error("Datastore needs to be opened.");try{await this.store.put(this.location,t,e.toBuffer())}catch(r){throw f.dbWriteFailedError(r)}}async get(e){if(null===this.store)throw new Error("Datastore needs to be opened.");let t;try{t=await this.store.get(this.location,e.toBuffer())}catch(r){throw f.dbWriteFailedError(r)}if(!t)throw f.notFoundError();return g(t)}async has(e){if(null===this.store)throw new Error("Datastore needs to be opened.");try{await this.get(e)}catch(t){if("ERR_NOT_FOUND"===t.code)return!1;throw t}return!0}async delete(e){if(null===this.store)throw new Error("Datastore needs to be opened.");try{await this.store.delete(this.location,e.toBuffer())}catch(t){throw f.dbDeleteFailedError(t)}}batch(){const e=[],t=[];return{put(t,r){e.push([t.toBuffer(),r])},delete(e){t.push(e.toBuffer())},commit:async()=>{if(null===this.store)throw new Error("Datastore needs to be opened.");const r=this.store.transaction(this.location,"readwrite"),n=r.store;await Promise.all(e.map(e=>n.put(e[1],e[0]))),await Promise.all(t.map(e=>n.delete(e))),await r.done}}}query(e){if(null===this.store)throw new Error("Datastore needs to be opened.");let t=d(e,this.store,this.location);return Array.isArray(e.filters)&&(t=e.filters.reduce((e,t)=>l(e,t),t)),Array.isArray(e.orders)&&(t=e.orders.reduce((e,t)=>h(e,t),t)),t}close(){if(null===this.store)throw new Error("Datastore needs to be opened.");return this.store.close()}destroy(){return c(this.location)}}},function(e,t,r){"use strict";const{Buffer:n}=r(0),{nanoid:o}=r(19),i=r(20),s=n.from("/"),a=s[0];class c{constructor(e,t){if("string"==typeof e?this._buf=n.from(e):n.isBuffer(e)&&(this._buf=e),null==t&&(t=!0),t&&this.clean(),0===this._buf.length||this._buf[0]!==a)throw new Error("Invalid key")}toString(e){return this._buf.toString(e||"utf8")}toBuffer(){return this._buf}get[Symbol.toStringTag](){return"[Key ".concat(this.toString(),"]")}static withNamespaces(e){return new u(e.join("/"))}static random(){return new u(o().replace(/-/g,""))}clean(){for(this._buf&&0!==this._buf.length||(this._buf=n.from("/")),this._buf[0]!==a&&(this._buf=n.concat([s,this._buf]));this._buf.length>1&&this._buf[this._buf.length-1]===a;)this._buf=this._buf.slice(0,-1)}less(e){const t=this.list(),r=e.list();for(let n=0;n<t.length;n++){if(r.length<n+1)return!1;const e=t[n],o=r[n];if(e<o)return!0;if(e>o)return!1}return t.length<r.length}reverse(){return c.withNamespaces(this.list().slice().reverse())}namespaces(){return this.list()}baseNamespace(){const e=this.namespaces();return e[e.length-1]}list(){return this.toString().split("/").slice(1)}type(){return function(e){const t=e.split(":");if(t.length<2)return"";return t.slice(0,-1).join(":")}(this.baseNamespace())}name(){return function(e){const t=e.split(":");return t[t.length-1]}(this.baseNamespace())}instance(e){return new u(this.toString()+":"+e)}path(){let e=this.parent().toString();return e.endsWith("/")||(e+="/"),e+=this.type(),new u(e)}parent(){const e=this.list();return 1===e.length?new u("/"):new u(e.slice(0,-1).join("/"))}child(e){return"/"===this.toString()?e:"/"===e.toString()?this:new u(this.toString()+e.toString(),!1)}isAncestorOf(e){return e.toString()!==this.toString()&&e.toString().startsWith(this.toString())}isDecendantOf(e){return e.toString()!==this.toString()&&this.toString().startsWith(e.toString())}isTopLevel(){return 1===this.list().length}concat(...e){return c.withNamespaces([...this.namespaces(),...(t=e.map(e=>e.namespaces()),[].concat(...t))]);var t}}const u=i(c,{className:"Key",symbolName:"@ipfs/interface-datastore/key"});e.exports=u},function(e,t,r){"use strict";function n(e){return new s(e)}function o(e){return function(){return new i(e.apply(this,arguments))}}function i(e){var t,r;function n(t,r){try{var i=e[t](r),a=i.value,c=a instanceof s;Promise.resolve(c?a.wrapped:a).then((function(e){c?n("return"===t?"return":"next",e):o(i.done?"return":"normal",e)}),(function(e){n("throw",e)}))}catch(u){o("throw",u)}}function o(e,o){switch(e){case"return":t.resolve({value:o,done:!0});break;case"throw":t.reject(o);break;default:t.resolve({value:o,done:!1})}(t=t.next)?n(t.key,t.arg):r=null}this._invoke=function(e,o){return new Promise((function(i,s){var a={key:e,arg:o,resolve:i,reject:s,next:null};r?r=r.next=a:(t=r=a,n(e,o))}))},"function"!=typeof e.return&&(this.return=void 0)}function s(e){this.wrapped=e}function a(e){var t;if("undefined"!=typeof Symbol){if(Symbol.asyncIterator&&null!=(t=e[Symbol.asyncIterator]))return t.call(e);if(Symbol.iterator&&null!=(t=e[Symbol.iterator]))return t.call(e)}throw new TypeError("Object is not async iterable")}"function"==typeof Symbol&&Symbol.asyncIterator&&(i.prototype[Symbol.asyncIterator]=function(){return this}),i.prototype.next=function(e){return this._invoke("next",e)},i.prototype.throw=function(e){return this._invoke("throw",e)},i.prototype.return=function(e){return this._invoke("return",e)};const c=r(22);t.filter=(e,t)=>o((function*(){var r,o=!0,i=!1;try{for(var s,c,u=a(e);o=(s=yield n(u.next())).done,c=yield n(s.value),!o;o=!0){const e=c;(yield n(t(e)))&&(yield e)}}catch(f){i=!0,r=f}finally{try{o||null==u.return||(yield n(u.return()))}finally{if(i)throw r}}}))(),t.sortAll=(e,t)=>o((function*(){let r=[];var o,i=!0,s=!1;try{for(var c,u,f=a(e);i=(c=yield n(f.next())).done,u=yield n(c.value),!i;i=!0){const e=u;r.push(e)}}catch(p){s=!0,o=p}finally{try{i||null==f.return||(yield n(f.return()))}finally{if(s)throw o}}r=yield n(t(r));for(const e of r)yield e}))(),t.take=(e,t)=>o((function*(){if(t<=0)return;let r=0;var o,i=!0,s=!1;try{for(var c,u,f=a(e);i=(c=yield n(f.next())).done,u=yield n(c.value),!i;i=!0){const e=u;if(yield e,r++,r>=t)return}}catch(p){s=!0,o=p}finally{try{i||null==f.return||(yield n(f.return()))}finally{if(s)throw o}}}))(),t.map=(e,t)=>o((function*(){var r,o=!0,i=!1;try{for(var s,c,u=a(e);o=(s=yield n(u.next())).done,c=yield n(s.value),!o;o=!0){const e=c;yield t(e)}}catch(f){i=!0,r=f}finally{try{o||null==u.return||(yield n(u.return()))}finally{if(i)throw r}}}))(),t.replaceStartWith=function(e,t){const r=new RegExp("^"+t);return e.replace(r,"")},t.tmpdir=c},function(e,t,r){"use strict";const n=r(24);e.exports.dbOpenFailedError=e=>(e=e||new Error("Cannot open database"),n(e,"ERR_DB_OPEN_FAILED")),e.exports.dbDeleteFailedError=e=>(e=e||new Error("Delete failed"),n(e,"ERR_DB_DELETE_FAILED")),e.exports.dbWriteFailedError=e=>(e=e||new Error("Write failed"),n(e,"ERR_DB_WRITE_FAILED")),e.exports.notFoundError=e=>(e=e||new Error("Not Found"),n(e,"ERR_NOT_FOUND"))},function(e,t,r){e.exports=r(9)},function(e,t,r){"use strict";const n=r(10),o=r(11),i=r(28),s=r(3),a=r(2)("repo-migrations:migrator");function c(e){return e=e||n,Array.isArray(e)&&0!==e.length?e[e.length-1].version:0}function u(e,t,r,n=!1){let o=0;for(const i of e){if(i.version>r)break;if(i.version>t){if(n&&!i.revert)throw new s.NonReversibleMigrationError("It is not possible to revert to version ".concat(t," because migration version ").concat(i.version," is not reversible. Cancelling reversion."));o++}}if(o!==r-t)throw new s.InvalidValueError("The ipfs-repo-migrations package does not have all migration to migrate from version ".concat(t," to ").concat(r))}t.getCurrentRepoVersion=o.getVersion,t.errors=s,t.getLatestMigrationVersion=c,t.migrate=async function(e,t,{ignoreLock:r=!1,repoOptions:f,onProgress:p,isDryRun:l=!1,migrations:h}){if(h=h||n,p=p||(()=>{}),!e)throw new s.RequiredParameterError("Path argument is required!");if(!t)throw new s.RequiredParameterError("toVersion argument is required!");if(!Number.isInteger(t)||t<=0)throw new s.InvalidValueError("Version has to be positive integer!");const g=await o.getVersion(e);if(g===t)return void a("Nothing to migrate.");if(g>t)throw new s.InvalidValueError("Current repo's version (".concat(g,") is higher then toVersion (").concat(t,"), you probably wanted to revert it?"));let _;u(h,g,t),l||r||(_=await i.lock(g,e));try{let n=0;const i=t-g;for(const r of h){if(void 0!==t&&r.version>t)break;if(!(r.version<=g)){n++,a("Migrating version ".concat(r.version));try{l||await r.migrate(e,f)}catch(d){const t=r.version-1;throw a("An exception was raised during execution of migration. Setting the repo's version to last successfully migrated version: ".concat(t)),await o.setVersion(e,t),d.message="During migration to version ".concat(r.version," exception was raised: ").concat(d.message),d}p(r,n,i),a("Migrating to version ".concat(r.version," finished"))}}l||await o.setVersion(e,t||c(h)),a("Repo successfully migrated ",void 0!==t?"to version ".concat(t,"!"):"to latest version!")}finally{l||r||await _.close()}},t.revert=async function(e,t,{ignoreLock:r=!1,repoOptions:c,onProgress:f,isDryRun:p=!1,migrations:l}){if(l=l||n,f=f||(()=>{}),!e)throw new s.RequiredParameterError("Path argument is required!");if(!t)throw new s.RequiredParameterError("When reverting migrations, you have to specify to which version to revert!");if(!Number.isInteger(t)||t<=0)throw new s.InvalidValueError("Version has to be positive integer!");const h=await o.getVersion(e);if(h===t)return void a("Nothing to revert.");if(h<t)throw new s.InvalidValueError("Current repo's version (".concat(h,") is lower then toVersion (").concat(t,"), you probably wanted to migrate it?"));let g;u(l,t,h,!0),p||r||(g=await i.lock(h,e)),a("Reverting from version ".concat(h," to ").concat(t));try{let n=0;const i=h-t,s=l.slice().reverse();for(const r of s){if(r.version<=t)break;if(!(r.version>h)){n++,a("Reverting migration version ".concat(r.version));try{p||await r.revert(e,c)}catch(_){const t=r.version;throw a("An exception was raised during execution of migration. Setting the repo's version to last successfully reverted version: ".concat(t)),await o.setVersion(e,t),_.message="During reversion to version ".concat(r.version," exception was raised: ").concat(_.message),_}f(r,n,i),a("Reverting to version ".concat(r.version," finished"))}}p||await o.setVersion(e,t),a("All migrations successfully reverted to version ".concat(t,"!"))}finally{p||r||await g.close()}}},function(e,t,r){"use strict";const n={description:"Empty migration.",migrate:()=>{},revert:()=>{},empty:!0};e.exports=[Object.assign({},n,{version:7,revert:void 0}),Object.assign({},n,{version:6,revert:void 0}),Object.assign({},n,{version:5,revert:void 0}),Object.assign({},n,{version:4,revert:void 0}),Object.assign({},n,{version:3,revert:void 0}),Object.assign({},n,{version:2,revert:void 0}),Object.assign({},n,{version:1,revert:void 0})]},function(e,t,r){"use strict";const{Buffer:n}=r(0),o=r(3),i=r(16),s=r(4),a=new(0,r(1).Key)("version");t.getVersion=async function(e){if(!await i.isRepoInitialized(e))throw new o.NotInitializedRepoError("Repo in path ".concat(e," is not initialized!"));const t=new s(e,{extension:"",createIfMissing:!1});await t.open();const r=parseInt(await t.get(a));return await t.close(),r},t.setVersion=async function(e,t){const r=new s(e,{extension:"",createIfMissing:!1});await r.open(),await r.put(a,n.from(String(t))),await r.close()}},function(e,t,r){"use strict";var n;n=function(){return this}();try{n=n||new Function("return this")()}catch(o){"object"==typeof window&&(n=window)}e.exports=n},function(e,t,r){"use strict";t.byteLength=function(e){var t=u(e),r=t[0],n=t[1];return 3*(r+n)/4-n},t.toByteArray=function(e){var t,r,n=u(e),s=n[0],a=n[1],c=new i(function(e,t,r){return 3*(t+r)/4-r}(0,s,a)),f=0,p=a>0?s-4:s;for(r=0;r<p;r+=4)t=o[e.charCodeAt(r)]<<18|o[e.charCodeAt(r+1)]<<12|o[e.charCodeAt(r+2)]<<6|o[e.charCodeAt(r+3)],c[f++]=t>>16&255,c[f++]=t>>8&255,c[f++]=255&t;2===a&&(t=o[e.charCodeAt(r)]<<2|o[e.charCodeAt(r+1)]>>4,c[f++]=255&t);1===a&&(t=o[e.charCodeAt(r)]<<10|o[e.charCodeAt(r+1)]<<4|o[e.charCodeAt(r+2)]>>2,c[f++]=t>>8&255,c[f++]=255&t);return c},t.fromByteArray=function(e){for(var t,r=e.length,o=r%3,i=[],s=0,a=r-o;s<a;s+=16383)i.push(f(e,s,s+16383>a?a:s+16383));1===o?(t=e[r-1],i.push(n[t>>2]+n[t<<4&63]+"==")):2===o&&(t=(e[r-2]<<8)+e[r-1],i.push(n[t>>10]+n[t>>4&63]+n[t<<2&63]+"="));return i.join("")};for(var n=[],o=[],i="undefined"!=typeof Uint8Array?Uint8Array:Array,s="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",a=0,c=s.length;a<c;++a)n[a]=s[a],o[s.charCodeAt(a)]=a;function u(e){var t=e.length;if(t%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var r=e.indexOf("=");return-1===r&&(r=t),[r,r===t?0:4-r%4]}function f(e,t,r){for(var o,i,s=[],a=t;a<r;a+=3)o=(e[a]<<16&16711680)+(e[a+1]<<8&65280)+(255&e[a+2]),s.push(n[(i=o)>>18&63]+n[i>>12&63]+n[i>>6&63]+n[63&i]);return s.join("")}o["-".charCodeAt(0)]=62,o["_".charCodeAt(0)]=63},function(e,t,r){"use strict";t.read=function(e,t,r,n,o){var i,s,a=8*o-n-1,c=(1<<a)-1,u=c>>1,f=-7,p=r?o-1:0,l=r?-1:1,h=e[t+p];for(p+=l,i=h&(1<<-f)-1,h>>=-f,f+=a;f>0;i=256*i+e[t+p],p+=l,f-=8);for(s=i&(1<<-f)-1,i>>=-f,f+=n;f>0;s=256*s+e[t+p],p+=l,f-=8);if(0===i)i=1-u;else{if(i===c)return s?NaN:1/0*(h?-1:1);s+=Math.pow(2,n),i-=u}return(h?-1:1)*s*Math.pow(2,i-n)},t.write=function(e,t,r,n,o,i){var s,a,c,u=8*i-o-1,f=(1<<u)-1,p=f>>1,l=23===o?Math.pow(2,-24)-Math.pow(2,-77):0,h=n?0:i-1,g=n?1:-1,_=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(a=isNaN(t)?1:0,s=f):(s=Math.floor(Math.log(t)/Math.LN2),t*(c=Math.pow(2,-s))<1&&(s--,c*=2),(t+=s+p>=1?l/c:l*Math.pow(2,1-p))*c>=2&&(s++,c/=2),s+p>=f?(a=0,s=f):s+p>=1?(a=(t*c-1)*Math.pow(2,o),s+=p):(a=t*Math.pow(2,p-1)*Math.pow(2,o),s=0));o>=8;e[r+h]=255&a,h+=g,a/=256,o-=8);for(s=s<<o|a,u+=o;u>0;e[r+h]=255&s,h+=g,s/=256,u-=8);e[r+h-g]|=128*_}},function(e,t,r){"use strict";var n={}.toString;e.exports=Array.isArray||function(e){return"[object Array]"==n.call(e)}},function(e,t,r){"use strict";const n=r(4),o=r(2)("repo-migrations:repo:init"),i=r(1).Key,s=new i("/version"),a=new i("/config");t.isRepoInitialized=async function(e){let t;try{t=new n(e,{extension:"",createIfMissing:!1}),await t.open();const r=await t.has(s),i=await t.has(a);return!(!r||!i)||(o("Version entry present: ".concat(r)),o("Config entry present: ".concat(i)),!1)}catch(r){return o("While checking if repo is initialized error was thrown: "+r.message),!1}finally{void 0!==t&&await t.close()}}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.deleteDB=function(e,{blocked:t}={}){const r=indexedDB.deleteDatabase(e);t&&r.addEventListener("blocked",()=>t());return(0,n.w)(r).then(()=>{})},t.openDB=function(e,t,{blocked:r,upgrade:o,blocking:i,terminated:s}={}){const a=indexedDB.open(e,t),c=(0,n.w)(a);o&&a.addEventListener("upgradeneeded",e=>{o((0,n.w)(a.result),e.oldVersion,e.newVersion,(0,n.w)(a.transaction))});r&&a.addEventListener("blocked",()=>r());return c.then(e=>{s&&e.addEventListener("close",()=>s()),i&&e.addEventListener("versionchange",()=>i())}).catch(()=>{}),c},Object.defineProperty(t,"unwrap",{enumerable:!0,get:function(){return n.u}}),Object.defineProperty(t,"wrap",{enumerable:!0,get:function(){return n.w}});var n=r(18);function o(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function i(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const s=["get","getKey","getAll","getAllKeys","count"],a=["put","add","delete","clear"],c=new Map;function u(e,t){if(!(e instanceof IDBDatabase)||t in e||"string"!=typeof t)return;if(c.get(t))return c.get(t);const r=t.replace(/FromIndex$/,""),n=t!==r,o=a.includes(r);if(!(r in(n?IDBIndex:IDBObjectStore).prototype)||!o&&!s.includes(r))return;const i=async function(e,...t){const i=this.transaction(e,o?"readwrite":"readonly");let s=i.store;n&&(s=s.index(t.shift()));const a=s[r](...t);return o&&await i.done,a};return c.set(t,i),i}(0,n.r)(e=>function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?o(Object(r),!0).forEach((function(t){i(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):o(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}({},e,{get:(t,r,n)=>u(t,r)||e.get(t,r,n),has:(t,r)=>!!u(t,r)||e.has(t,r)}))},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.r=function(e){p=e(p)},t.w=g,t.u=t.i=t.a=void 0;const n=(e,t)=>t.some(t=>e instanceof t);let o,i;t.i=n;const s=new WeakMap,a=new WeakMap,c=new WeakMap,u=new WeakMap,f=new WeakMap;t.a=f;let p={get(e,t,r){if(e instanceof IDBTransaction){if("done"===t)return a.get(e);if("objectStoreNames"===t)return e.objectStoreNames||c.get(e);if("store"===t)return r.objectStoreNames[1]?void 0:r.objectStore(r.objectStoreNames[0])}return g(e[t])},set:(e,t,r)=>(e[t]=r,!0),has:(e,t)=>e instanceof IDBTransaction&&("done"===t||"store"===t)||t in e};function l(e){return e!==IDBDatabase.prototype.transaction||"objectStoreNames"in IDBTransaction.prototype?(i||(i=[IDBCursor.prototype.advance,IDBCursor.prototype.continue,IDBCursor.prototype.continuePrimaryKey])).includes(e)?function(...t){return e.apply(_(this),t),g(s.get(this))}:function(...t){return g(e.apply(_(this),t))}:function(t,...r){const n=e.call(_(this),t,...r);return c.set(n,t.sort?t.sort():[t]),g(n)}}function h(e){return"function"==typeof e?l(e):(e instanceof IDBTransaction&&function(e){if(a.has(e))return;const t=new Promise((t,r)=>{const n=()=>{e.removeEventListener("complete",o),e.removeEventListener("error",i),e.removeEventListener("abort",i)},o=()=>{t(),n()},i=()=>{r(e.error||new DOMException("AbortError","AbortError")),n()};e.addEventListener("complete",o),e.addEventListener("error",i),e.addEventListener("abort",i)});a.set(e,t)}(e),n(e,o||(o=[IDBDatabase,IDBObjectStore,IDBIndex,IDBCursor,IDBTransaction]))?new Proxy(e,p):e)}function g(e){if(e instanceof IDBRequest)return function(e){const t=new Promise((t,r)=>{const n=()=>{e.removeEventListener("success",o),e.removeEventListener("error",i)},o=()=>{t(g(e.result)),n()},i=()=>{r(e.error),n()};e.addEventListener("success",o),e.addEventListener("error",i)});return t.then(t=>{t instanceof IDBCursor&&s.set(t,e)}).catch(()=>{}),f.set(t,e),t}(e);if(u.has(e))return u.get(e);const t=h(e);return t!==e&&(u.set(e,t),f.set(t,e)),t}const _=e=>f.get(e);t.u=_},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.random=t.urlAlphabet=t.customRandom=t.customAlphabet=t.nanoid=void 0;t.urlAlphabet="ModuleSymbhasOwnPr-0123456789ABCDEFGHNRVfgctiUvz_KqYTJkLxpZXIjQW";let n=e=>crypto.getRandomValues(new Uint8Array(e));t.random=n;let o=(e,t,r)=>{let n=(2<<Math.log(e.length-1)/Math.LN2)-1,o=-~(1.6*n*t/e.length);return()=>{let i="";for(;;){let s=r(o),a=o;for(;a--;)if(i+=e[s[a]&n]||"",i.length===+t)return i}}};t.customRandom=o;t.customAlphabet=(e,t)=>o(e,t,n);t.nanoid=(e=21)=>{let t="",r=crypto.getRandomValues(new Uint8Array(e));for(;e--;){let n=63&r[e];t+=n<36?n.toString(36):n<62?(n-26).toString(36).toUpperCase():n<63?"_":"-"}return t}},function(e,t,r){"use strict";e.exports=function(e,{className:t,symbolName:r}){const n=Symbol.for(r),o={[t]:class extends e{constructor(...e){super(...e),Object.defineProperty(this,n,{value:!0})}get[Symbol.toStringTag](){return t}}}[t];return o["is".concat(t)]=e=>!(!e||!e[n]),o},e.exports.proto=function(e,{className:t,symbolName:r,withoutNew:n}){const o=Symbol.for(r),i={[t]:function(...t){if(n&&!(this instanceof i))return new i(...t);const r=e.call(this,...t)||this;return r&&!r[o]&&Object.defineProperty(r,o,{value:!0}),r}}[t];return i.prototype=Object.create(e.prototype),i.prototype.constructor=i,Object.defineProperty(i.prototype,Symbol.toStringTag,{get:()=>t}),i["is".concat(t)]=e=>!(!e||!e[o]),i}},function(e,t,r){"use strict";const{filter:n,sortAll:o,take:i,map:s}=r(6),a=r(5),c=r(7);e.exports=class{constructor(){this.data={}}async open(){}async put(e,t){this.data[e.toString()]=t}async get(e){if(!await this.has(e))throw c.notFoundError();return this.data[e.toString()]}async has(e){return void 0!==this.data[e.toString()]}async delete(e){delete this.data[e.toString()]}batch(){let e=[],t=[];return{put(t,r){e.push([t,r])},delete(e){t.push(e)},commit:async()=>{e.forEach(e=>{this.data[e[0].toString()]=e[1]}),e=[],t.forEach(e=>{delete this.data[e.toString()]}),t=[]}}}query(e){let t=Object.entries(this.data);if(t=s(t,e=>({key:new a(e[0]),value:e[1]})),null!=e.prefix&&(t=n(t,t=>t.key.toString().startsWith(e.prefix))),Array.isArray(e.filters)&&(t=e.filters.reduce((e,t)=>n(e,t),t)),Array.isArray(e.orders)&&(t=e.orders.reduce((e,t)=>o(e,t),t)),null!=e.offset){let r=0;t=n(t,()=>r++>=e.offset)}return null!=e.limit&&(t=i(t,e.limit)),!0===e.keysOnly&&(t=s(t,e=>({key:e.key}))),t}async close(){}}},function(e,t,r){"use strict";const n=r(23);e.exports=(e=(e=>e))=>e(n())},function(e,t,r){"use strict";for(var n=self.crypto||self.msCrypto,o="-_",i=36;i--;)o+=i.toString(36);for(i=36;i---10;)o+=i.toString(36).toUpperCase();e.exports=function(e){var t="",r=n.getRandomValues(new Uint8Array(e||21));for(i=e||21;i--;)t+=o[63&r[i]];return t}},function(e,t,r){"use strict";e.exports=function(e,t,r){var n;if(!(e instanceof Error))throw new TypeError("Please pass an Error to err-code");if("object"==typeof t?r=t:null!=t&&(e.code=t),r)for(n in r)e[n]=r[n];return e}},function(e,t,r){"use strict";var n,o,i=e.exports={};function s(){throw new Error("setTimeout has not been defined")}function a(){throw new Error("clearTimeout has not been defined")}function c(e){if(n===setTimeout)return setTimeout(e,0);if((n===s||!n)&&setTimeout)return n=setTimeout,setTimeout(e,0);try{return n(e,0)}catch(t){try{return n.call(null,e,0)}catch(t){return n.call(this,e,0)}}}!function(){try{n="function"==typeof setTimeout?setTimeout:s}catch(e){n=s}try{o="function"==typeof clearTimeout?clearTimeout:a}catch(e){o=a}}();var u,f=[],p=!1,l=-1;function h(){p&&u&&(p=!1,u.length?f=u.concat(f):l=-1,f.length&&g())}function g(){if(!p){var e=c(h);p=!0;for(var t=f.length;t;){for(u=f,f=[];++l<t;)u&&u[l].run();l=-1,t=f.length}u=null,p=!1,function(e){if(o===clearTimeout)return clearTimeout(e);if((o===a||!o)&&clearTimeout)return o=clearTimeout,clearTimeout(e);try{o(e)}catch(t){try{return o.call(null,e)}catch(t){return o.call(this,e)}}}(e)}}function _(e,t){this.fun=e,this.array=t}function d(){}i.nextTick=function(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var r=1;r<arguments.length;r++)t[r-1]=arguments[r];f.push(new _(e,t)),1!==f.length||p||c(g)},_.prototype.run=function(){this.fun.apply(null,this.array)},i.title="browser",i.browser=!0,i.env={},i.argv=[],i.version="",i.versions={},i.on=d,i.addListener=d,i.once=d,i.off=d,i.removeListener=d,i.removeAllListeners=d,i.emit=d,i.prependListener=d,i.prependOnceListener=d,i.listeners=function(e){return[]},i.binding=function(e){throw new Error("process.binding is not supported")},i.cwd=function(){return"/"},i.chdir=function(e){throw new Error("process.chdir is not supported")},i.umask=function(){return 0}},function(e,t,r){"use strict";e.exports=function(e){function t(e){let t=0;for(let r=0;r<e.length;r++)t=(t<<5)-t+e.charCodeAt(r),t|=0;return n.colors[Math.abs(t)%n.colors.length]}function n(e){let r;function s(...e){if(!s.enabled)return;const t=s,o=Number(new Date),i=o-(r||o);t.diff=i,t.prev=r,t.curr=o,r=o,e[0]=n.coerce(e[0]),"string"!=typeof e[0]&&e.unshift("%O");let a=0;e[0]=e[0].replace(/%([a-zA-Z%])/g,(r,o)=>{if("%%"===r)return r;a++;const i=n.formatters[o];if("function"==typeof i){const n=e[a];r=i.call(t,n),e.splice(a,1),a--}return r}),n.formatArgs.call(t,e),(t.log||n.log).apply(t,e)}return s.namespace=e,s.enabled=n.enabled(e),s.useColors=n.useColors(),s.color=t(e),s.destroy=o,s.extend=i,"function"==typeof n.init&&n.init(s),n.instances.push(s),s}function o(){const e=n.instances.indexOf(this);return-1!==e&&(n.instances.splice(e,1),!0)}function i(e,t){const r=n(this.namespace+(void 0===t?":":t)+e);return r.log=this.log,r}function s(e){return e.toString().substring(2,e.toString().length-2).replace(/\.\*\?$/,"*")}return n.debug=n,n.default=n,n.coerce=function(e){if(e instanceof Error)return e.stack||e.message;return e},n.disable=function(){const e=[...n.names.map(s),...n.skips.map(s).map(e=>"-"+e)].join(",");return n.enable(""),e},n.enable=function(e){let t;n.save(e),n.names=[],n.skips=[];const r=("string"==typeof e?e:"").split(/[\s,]+/),o=r.length;for(t=0;t<o;t++)r[t]&&("-"===(e=r[t].replace(/\*/g,".*?"))[0]?n.skips.push(new RegExp("^"+e.substr(1)+"$")):n.names.push(new RegExp("^"+e+"$")));for(t=0;t<n.instances.length;t++){const e=n.instances[t];e.enabled=n.enabled(e.namespace)}},n.enabled=function(e){if("*"===e[e.length-1])return!0;let t,r;for(t=0,r=n.skips.length;t<r;t++)if(n.skips[t].test(e))return!1;for(t=0,r=n.names.length;t<r;t++)if(n.names[t].test(e))return!0;return!1},n.humanize=r(27),Object.keys(e).forEach(t=>{n[t]=e[t]}),n.instances=[],n.names=[],n.skips=[],n.formatters={},n.selectColor=t,n.enable(n.load()),n}},function(e,t,r){"use strict";var n=1e3,o=6e4,i=60*o,s=24*i;function a(e,t,r,n){var o=t>=1.5*r;return Math.round(e/r)+" "+n+(o?"s":"")}e.exports=function(e,t){t=t||{};var r=typeof e;if("string"===r&&e.length>0)return function(e){if((e=String(e)).length>100)return;var t=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(e);if(!t)return;var r=parseFloat(t[1]);switch((t[2]||"ms").toLowerCase()){case"years":case"year":case"yrs":case"yr":case"y":return 315576e5*r;case"weeks":case"week":case"w":return 6048e5*r;case"days":case"day":case"d":return r*s;case"hours":case"hour":case"hrs":case"hr":case"h":return r*i;case"minutes":case"minute":case"mins":case"min":case"m":return r*o;case"seconds":case"second":case"secs":case"sec":case"s":return r*n;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return r;default:return}}(e);if("number"===r&&isFinite(e))return t.long?function(e){var t=Math.abs(e);if(t>=s)return a(e,t,s,"day");if(t>=i)return a(e,t,i,"hour");if(t>=o)return a(e,t,o,"minute");if(t>=n)return a(e,t,n,"second");return e+" ms"}(e):function(e){var t=Math.abs(e);if(t>=s)return Math.round(e/s)+"d";if(t>=i)return Math.round(e/i)+"h";if(t>=o)return Math.round(e/o)+"m";if(t>=n)return Math.round(e/n)+"s";return e+"ms"}(e);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(e))}},function(e,t,r){"use strict";const n=r(2)("repo-migrations:repo_mem_lock"),o={};t.lock=async function(e,t){const r=t+"/repo.lock";if(n("locking %s",r),!0===o[r])throw Error("There is already present lock for: ".concat(r));return o[r]=!0,{close(){o[r]&&(n("releasing lock %s",r),delete o[r])}}}}])}));
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.IpfsRepoMigrations=t():e.IpfsRepoMigrations=t()}(window,(function(){return function(e){var t={};function r(n){if(t[n])return t[n].exports;var o=t[n]={i:n,l:!1,exports:{}};return e[n].call(o.exports,o,o.exports,r),o.l=!0,o.exports}return r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)r.d(n,o,function(t){return e[t]}.bind(null,o));return n},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s=8)}([function(e,t,r){"use strict";(function(e){var n=r(13),o=r(14),i=r(15);function s(){return c.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function a(e,t){if(s()<t)throw new RangeError("Invalid typed array length");return c.TYPED_ARRAY_SUPPORT?(e=new Uint8Array(t)).__proto__=c.prototype:(null===e&&(e=new c(t)),e.length=t),e}function c(e,t,r){if(!(c.TYPED_ARRAY_SUPPORT||this instanceof c))return new c(e,t,r);if("number"==typeof e){if("string"==typeof t)throw new Error("If encoding is specified then the first argument must be a string");return l(this,e)}return u(this,e,t,r)}function u(e,t,r,n){if("number"==typeof t)throw new TypeError('"value" argument must not be a number');return"undefined"!=typeof ArrayBuffer&&t instanceof ArrayBuffer?function(e,t,r,n){if(t.byteLength,r<0||t.byteLength<r)throw new RangeError("'offset' is out of bounds");if(t.byteLength<r+(n||0))throw new RangeError("'length' is out of bounds");t=void 0===r&&void 0===n?new Uint8Array(t):void 0===n?new Uint8Array(t,r):new Uint8Array(t,r,n);c.TYPED_ARRAY_SUPPORT?(e=t).__proto__=c.prototype:e=p(e,t);return e}(e,t,r,n):"string"==typeof t?function(e,t,r){"string"==typeof r&&""!==r||(r="utf8");if(!c.isEncoding(r))throw new TypeError('"encoding" must be a valid string encoding');var n=0|g(t,r),o=(e=a(e,n)).write(t,r);o!==n&&(e=e.slice(0,o));return e}(e,t,r):function(e,t){if(c.isBuffer(t)){var r=0|h(t.length);return 0===(e=a(e,r)).length||t.copy(e,0,0,r),e}if(t){if("undefined"!=typeof ArrayBuffer&&t.buffer instanceof ArrayBuffer||"length"in t)return"number"!=typeof t.length||(n=t.length)!=n?a(e,0):p(e,t);if("Buffer"===t.type&&i(t.data))return p(e,t.data)}var n;throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}(e,t)}function f(e){if("number"!=typeof e)throw new TypeError('"size" argument must be a number');if(e<0)throw new RangeError('"size" argument must not be negative')}function l(e,t){if(f(t),e=a(e,t<0?0:0|h(t)),!c.TYPED_ARRAY_SUPPORT)for(var r=0;r<t;++r)e[r]=0;return e}function p(e,t){var r=t.length<0?0:0|h(t.length);e=a(e,r);for(var n=0;n<r;n+=1)e[n]=255&t[n];return e}function h(e){if(e>=s())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+s().toString(16)+" bytes");return 0|e}function g(e,t){if(c.isBuffer(e))return e.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(e)||e instanceof ArrayBuffer))return e.byteLength;"string"!=typeof e&&(e=""+e);var r=e.length;if(0===r)return 0;for(var n=!1;;)switch(t){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":case void 0:return j(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return V(e).length;default:if(n)return j(e).length;t=(""+t).toLowerCase(),n=!0}}function _(e,t,r){var n=!1;if((void 0===t||t<0)&&(t=0),t>this.length)return"";if((void 0===r||r>this.length)&&(r=this.length),r<=0)return"";if((r>>>=0)<=(t>>>=0))return"";for(e||(e="utf8");;)switch(e){case"hex":return T(this,t,r);case"utf8":case"utf-8":return k(this,t,r);case"ascii":return S(this,t,r);case"latin1":case"binary":return I(this,t,r);case"base64":return R(this,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return O(this,t,r);default:if(n)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),n=!0}}function d(e,t,r){var n=e[t];e[t]=e[r],e[r]=n}function m(e,t,r,n,o){if(0===e.length)return-1;if("string"==typeof r?(n=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),r=+r,isNaN(r)&&(r=o?0:e.length-1),r<0&&(r=e.length+r),r>=e.length){if(o)return-1;r=e.length-1}else if(r<0){if(!o)return-1;r=0}if("string"==typeof t&&(t=c.from(t,n)),c.isBuffer(t))return 0===t.length?-1:y(e,t,r,n,o);if("number"==typeof t)return t&=255,c.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?o?Uint8Array.prototype.indexOf.call(e,t,r):Uint8Array.prototype.lastIndexOf.call(e,t,r):y(e,[t],r,n,o);throw new TypeError("val must be string, number or Buffer")}function y(e,t,r,n,o){var i,s=1,a=e.length,c=t.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(e.length<2||t.length<2)return-1;s=2,a/=2,c/=2,r/=2}function u(e,t){return 1===s?e[t]:e.readUInt16BE(t*s)}if(o){var f=-1;for(i=r;i<a;i++)if(u(e,i)===u(t,-1===f?0:i-f)){if(-1===f&&(f=i),i-f+1===c)return f*s}else-1!==f&&(i-=i-f),f=-1}else for(r+c>a&&(r=a-c),i=r;i>=0;i--){for(var l=!0,p=0;p<c;p++)if(u(e,i+p)!==u(t,p)){l=!1;break}if(l)return i}return-1}function v(e,t,r,n){r=Number(r)||0;var o=e.length-r;n?(n=Number(n))>o&&(n=o):n=o;var i=t.length;if(i%2!=0)throw new TypeError("Invalid hex string");n>i/2&&(n=i/2);for(var s=0;s<n;++s){var a=parseInt(t.substr(2*s,2),16);if(isNaN(a))return s;e[r+s]=a}return s}function w(e,t,r,n){return Y(j(t,e.length-r),e,r,n)}function b(e,t,r,n){return Y(function(e){for(var t=[],r=0;r<e.length;++r)t.push(255&e.charCodeAt(r));return t}(t),e,r,n)}function E(e,t,r,n){return b(e,t,r,n)}function A(e,t,r,n){return Y(V(t),e,r,n)}function C(e,t,r,n){return Y(function(e,t){for(var r,n,o,i=[],s=0;s<e.length&&!((t-=2)<0);++s)r=e.charCodeAt(s),n=r>>8,o=r%256,i.push(o),i.push(n);return i}(t,e.length-r),e,r,n)}function R(e,t,r){return 0===t&&r===e.length?n.fromByteArray(e):n.fromByteArray(e.slice(t,r))}function k(e,t,r){r=Math.min(e.length,r);for(var n=[],o=t;o<r;){var i,s,a,c,u=e[o],f=null,l=u>239?4:u>223?3:u>191?2:1;if(o+l<=r)switch(l){case 1:u<128&&(f=u);break;case 2:128==(192&(i=e[o+1]))&&(c=(31&u)<<6|63&i)>127&&(f=c);break;case 3:i=e[o+1],s=e[o+2],128==(192&i)&&128==(192&s)&&(c=(15&u)<<12|(63&i)<<6|63&s)>2047&&(c<55296||c>57343)&&(f=c);break;case 4:i=e[o+1],s=e[o+2],a=e[o+3],128==(192&i)&&128==(192&s)&&128==(192&a)&&(c=(15&u)<<18|(63&i)<<12|(63&s)<<6|63&a)>65535&&c<1114112&&(f=c)}null===f?(f=65533,l=1):f>65535&&(f-=65536,n.push(f>>>10&1023|55296),f=56320|1023&f),n.push(f),o+=l}return function(e){var t=e.length;if(t<=4096)return String.fromCharCode.apply(String,e);var r="",n=0;for(;n<t;)r+=String.fromCharCode.apply(String,e.slice(n,n+=4096));return r}(n)}t.Buffer=c,t.SlowBuffer=function(e){+e!=e&&(e=0);return c.alloc(+e)},t.INSPECT_MAX_BYTES=50,c.TYPED_ARRAY_SUPPORT=void 0!==e.TYPED_ARRAY_SUPPORT?e.TYPED_ARRAY_SUPPORT:function(){try{var e=new Uint8Array(1);return e.__proto__={__proto__:Uint8Array.prototype,foo:function(){return 42}},42===e.foo()&&"function"==typeof e.subarray&&0===e.subarray(1,1).byteLength}catch(t){return!1}}(),t.kMaxLength=s(),c.poolSize=8192,c._augment=function(e){return e.__proto__=c.prototype,e},c.from=function(e,t,r){return u(null,e,t,r)},c.TYPED_ARRAY_SUPPORT&&(c.prototype.__proto__=Uint8Array.prototype,c.__proto__=Uint8Array,"undefined"!=typeof Symbol&&Symbol.species&&c[Symbol.species]===c&&Object.defineProperty(c,Symbol.species,{value:null,configurable:!0})),c.alloc=function(e,t,r){return function(e,t,r,n){return f(t),t<=0?a(e,t):void 0!==r?"string"==typeof n?a(e,t).fill(r,n):a(e,t).fill(r):a(e,t)}(null,e,t,r)},c.allocUnsafe=function(e){return l(null,e)},c.allocUnsafeSlow=function(e){return l(null,e)},c.isBuffer=function(e){return!(null==e||!e._isBuffer)},c.compare=function(e,t){if(!c.isBuffer(e)||!c.isBuffer(t))throw new TypeError("Arguments must be Buffers");if(e===t)return 0;for(var r=e.length,n=t.length,o=0,i=Math.min(r,n);o<i;++o)if(e[o]!==t[o]){r=e[o],n=t[o];break}return r<n?-1:n<r?1:0},c.isEncoding=function(e){switch(String(e).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},c.concat=function(e,t){if(!i(e))throw new TypeError('"list" argument must be an Array of Buffers');if(0===e.length)return c.alloc(0);var r;if(void 0===t)for(t=0,r=0;r<e.length;++r)t+=e[r].length;var n=c.allocUnsafe(t),o=0;for(r=0;r<e.length;++r){var s=e[r];if(!c.isBuffer(s))throw new TypeError('"list" argument must be an Array of Buffers');s.copy(n,o),o+=s.length}return n},c.byteLength=g,c.prototype._isBuffer=!0,c.prototype.swap16=function(){var e=this.length;if(e%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var t=0;t<e;t+=2)d(this,t,t+1);return this},c.prototype.swap32=function(){var e=this.length;if(e%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var t=0;t<e;t+=4)d(this,t,t+3),d(this,t+1,t+2);return this},c.prototype.swap64=function(){var e=this.length;if(e%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var t=0;t<e;t+=8)d(this,t,t+7),d(this,t+1,t+6),d(this,t+2,t+5),d(this,t+3,t+4);return this},c.prototype.toString=function(){var e=0|this.length;return 0===e?"":0===arguments.length?k(this,0,e):_.apply(this,arguments)},c.prototype.equals=function(e){if(!c.isBuffer(e))throw new TypeError("Argument must be a Buffer");return this===e||0===c.compare(this,e)},c.prototype.inspect=function(){var e="",r=t.INSPECT_MAX_BYTES;return this.length>0&&(e=this.toString("hex",0,r).match(/.{2}/g).join(" "),this.length>r&&(e+=" ... ")),"<Buffer "+e+">"},c.prototype.compare=function(e,t,r,n,o){if(!c.isBuffer(e))throw new TypeError("Argument must be a Buffer");if(void 0===t&&(t=0),void 0===r&&(r=e?e.length:0),void 0===n&&(n=0),void 0===o&&(o=this.length),t<0||r>e.length||n<0||o>this.length)throw new RangeError("out of range index");if(n>=o&&t>=r)return 0;if(n>=o)return-1;if(t>=r)return 1;if(this===e)return 0;for(var i=(o>>>=0)-(n>>>=0),s=(r>>>=0)-(t>>>=0),a=Math.min(i,s),u=this.slice(n,o),f=e.slice(t,r),l=0;l<a;++l)if(u[l]!==f[l]){i=u[l],s=f[l];break}return i<s?-1:s<i?1:0},c.prototype.includes=function(e,t,r){return-1!==this.indexOf(e,t,r)},c.prototype.indexOf=function(e,t,r){return m(this,e,t,r,!0)},c.prototype.lastIndexOf=function(e,t,r){return m(this,e,t,r,!1)},c.prototype.write=function(e,t,r,n){if(void 0===t)n="utf8",r=this.length,t=0;else if(void 0===r&&"string"==typeof t)n=t,r=this.length,t=0;else{if(!isFinite(t))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");t|=0,isFinite(r)?(r|=0,void 0===n&&(n="utf8")):(n=r,r=void 0)}var o=this.length-t;if((void 0===r||r>o)&&(r=o),e.length>0&&(r<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");for(var i=!1;;)switch(n){case"hex":return v(this,e,t,r);case"utf8":case"utf-8":return w(this,e,t,r);case"ascii":return b(this,e,t,r);case"latin1":case"binary":return E(this,e,t,r);case"base64":return A(this,e,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return C(this,e,t,r);default:if(i)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),i=!0}},c.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function S(e,t,r){var n="";r=Math.min(e.length,r);for(var o=t;o<r;++o)n+=String.fromCharCode(127&e[o]);return n}function I(e,t,r){var n="";r=Math.min(e.length,r);for(var o=t;o<r;++o)n+=String.fromCharCode(e[o]);return n}function T(e,t,r){var n=e.length;(!t||t<0)&&(t=0),(!r||r<0||r>n)&&(r=n);for(var o="",i=t;i<r;++i)o+=M(e[i]);return o}function O(e,t,r){for(var n=e.slice(t,r),o="",i=0;i<n.length;i+=2)o+=String.fromCharCode(n[i]+256*n[i+1]);return o}function P(e,t,r){if(e%1!=0||e<0)throw new RangeError("offset is not uint");if(e+t>r)throw new RangeError("Trying to access beyond buffer length")}function x(e,t,r,n,o,i){if(!c.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>o||t<i)throw new RangeError('"value" argument is out of bounds');if(r+n>e.length)throw new RangeError("Index out of range")}function D(e,t,r,n){t<0&&(t=65535+t+1);for(var o=0,i=Math.min(e.length-r,2);o<i;++o)e[r+o]=(t&255<<8*(n?o:1-o))>>>8*(n?o:1-o)}function F(e,t,r,n){t<0&&(t=4294967295+t+1);for(var o=0,i=Math.min(e.length-r,4);o<i;++o)e[r+o]=t>>>8*(n?o:3-o)&255}function U(e,t,r,n,o,i){if(r+n>e.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function B(e,t,r,n,i){return i||U(e,0,r,4),o.write(e,t,r,n,23,4),r+4}function L(e,t,r,n,i){return i||U(e,0,r,8),o.write(e,t,r,n,52,8),r+8}c.prototype.slice=function(e,t){var r,n=this.length;if((e=~~e)<0?(e+=n)<0&&(e=0):e>n&&(e=n),(t=void 0===t?n:~~t)<0?(t+=n)<0&&(t=0):t>n&&(t=n),t<e&&(t=e),c.TYPED_ARRAY_SUPPORT)(r=this.subarray(e,t)).__proto__=c.prototype;else{var o=t-e;r=new c(o,void 0);for(var i=0;i<o;++i)r[i]=this[i+e]}return r},c.prototype.readUIntLE=function(e,t,r){e|=0,t|=0,r||P(e,t,this.length);for(var n=this[e],o=1,i=0;++i<t&&(o*=256);)n+=this[e+i]*o;return n},c.prototype.readUIntBE=function(e,t,r){e|=0,t|=0,r||P(e,t,this.length);for(var n=this[e+--t],o=1;t>0&&(o*=256);)n+=this[e+--t]*o;return n},c.prototype.readUInt8=function(e,t){return t||P(e,1,this.length),this[e]},c.prototype.readUInt16LE=function(e,t){return t||P(e,2,this.length),this[e]|this[e+1]<<8},c.prototype.readUInt16BE=function(e,t){return t||P(e,2,this.length),this[e]<<8|this[e+1]},c.prototype.readUInt32LE=function(e,t){return t||P(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},c.prototype.readUInt32BE=function(e,t){return t||P(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},c.prototype.readIntLE=function(e,t,r){e|=0,t|=0,r||P(e,t,this.length);for(var n=this[e],o=1,i=0;++i<t&&(o*=256);)n+=this[e+i]*o;return n>=(o*=128)&&(n-=Math.pow(2,8*t)),n},c.prototype.readIntBE=function(e,t,r){e|=0,t|=0,r||P(e,t,this.length);for(var n=t,o=1,i=this[e+--n];n>0&&(o*=256);)i+=this[e+--n]*o;return i>=(o*=128)&&(i-=Math.pow(2,8*t)),i},c.prototype.readInt8=function(e,t){return t||P(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},c.prototype.readInt16LE=function(e,t){t||P(e,2,this.length);var r=this[e]|this[e+1]<<8;return 32768&r?4294901760|r:r},c.prototype.readInt16BE=function(e,t){t||P(e,2,this.length);var r=this[e+1]|this[e]<<8;return 32768&r?4294901760|r:r},c.prototype.readInt32LE=function(e,t){return t||P(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},c.prototype.readInt32BE=function(e,t){return t||P(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},c.prototype.readFloatLE=function(e,t){return t||P(e,4,this.length),o.read(this,e,!0,23,4)},c.prototype.readFloatBE=function(e,t){return t||P(e,4,this.length),o.read(this,e,!1,23,4)},c.prototype.readDoubleLE=function(e,t){return t||P(e,8,this.length),o.read(this,e,!0,52,8)},c.prototype.readDoubleBE=function(e,t){return t||P(e,8,this.length),o.read(this,e,!1,52,8)},c.prototype.writeUIntLE=function(e,t,r,n){(e=+e,t|=0,r|=0,n)||x(this,e,t,r,Math.pow(2,8*r)-1,0);var o=1,i=0;for(this[t]=255&e;++i<r&&(o*=256);)this[t+i]=e/o&255;return t+r},c.prototype.writeUIntBE=function(e,t,r,n){(e=+e,t|=0,r|=0,n)||x(this,e,t,r,Math.pow(2,8*r)-1,0);var o=r-1,i=1;for(this[t+o]=255&e;--o>=0&&(i*=256);)this[t+o]=e/i&255;return t+r},c.prototype.writeUInt8=function(e,t,r){return e=+e,t|=0,r||x(this,e,t,1,255,0),c.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),this[t]=255&e,t+1},c.prototype.writeUInt16LE=function(e,t,r){return e=+e,t|=0,r||x(this,e,t,2,65535,0),c.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):D(this,e,t,!0),t+2},c.prototype.writeUInt16BE=function(e,t,r){return e=+e,t|=0,r||x(this,e,t,2,65535,0),c.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):D(this,e,t,!1),t+2},c.prototype.writeUInt32LE=function(e,t,r){return e=+e,t|=0,r||x(this,e,t,4,4294967295,0),c.TYPED_ARRAY_SUPPORT?(this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e):F(this,e,t,!0),t+4},c.prototype.writeUInt32BE=function(e,t,r){return e=+e,t|=0,r||x(this,e,t,4,4294967295,0),c.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):F(this,e,t,!1),t+4},c.prototype.writeIntLE=function(e,t,r,n){if(e=+e,t|=0,!n){var o=Math.pow(2,8*r-1);x(this,e,t,r,o-1,-o)}var i=0,s=1,a=0;for(this[t]=255&e;++i<r&&(s*=256);)e<0&&0===a&&0!==this[t+i-1]&&(a=1),this[t+i]=(e/s>>0)-a&255;return t+r},c.prototype.writeIntBE=function(e,t,r,n){if(e=+e,t|=0,!n){var o=Math.pow(2,8*r-1);x(this,e,t,r,o-1,-o)}var i=r-1,s=1,a=0;for(this[t+i]=255&e;--i>=0&&(s*=256);)e<0&&0===a&&0!==this[t+i+1]&&(a=1),this[t+i]=(e/s>>0)-a&255;return t+r},c.prototype.writeInt8=function(e,t,r){return e=+e,t|=0,r||x(this,e,t,1,127,-128),c.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),e<0&&(e=255+e+1),this[t]=255&e,t+1},c.prototype.writeInt16LE=function(e,t,r){return e=+e,t|=0,r||x(this,e,t,2,32767,-32768),c.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):D(this,e,t,!0),t+2},c.prototype.writeInt16BE=function(e,t,r){return e=+e,t|=0,r||x(this,e,t,2,32767,-32768),c.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):D(this,e,t,!1),t+2},c.prototype.writeInt32LE=function(e,t,r){return e=+e,t|=0,r||x(this,e,t,4,2147483647,-2147483648),c.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24):F(this,e,t,!0),t+4},c.prototype.writeInt32BE=function(e,t,r){return e=+e,t|=0,r||x(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),c.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):F(this,e,t,!1),t+4},c.prototype.writeFloatLE=function(e,t,r){return B(this,e,t,!0,r)},c.prototype.writeFloatBE=function(e,t,r){return B(this,e,t,!1,r)},c.prototype.writeDoubleLE=function(e,t,r){return L(this,e,t,!0,r)},c.prototype.writeDoubleBE=function(e,t,r){return L(this,e,t,!1,r)},c.prototype.copy=function(e,t,r,n){if(r||(r=0),n||0===n||(n=this.length),t>=e.length&&(t=e.length),t||(t=0),n>0&&n<r&&(n=r),n===r)return 0;if(0===e.length||0===this.length)return 0;if(t<0)throw new RangeError("targetStart out of bounds");if(r<0||r>=this.length)throw new RangeError("sourceStart out of bounds");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),e.length-t<n-r&&(n=e.length-t+r);var o,i=n-r;if(this===e&&r<t&&t<n)for(o=i-1;o>=0;--o)e[o+t]=this[o+r];else if(i<1e3||!c.TYPED_ARRAY_SUPPORT)for(o=0;o<i;++o)e[o+t]=this[o+r];else Uint8Array.prototype.set.call(e,this.subarray(r,r+i),t);return i},c.prototype.fill=function(e,t,r,n){if("string"==typeof e){if("string"==typeof t?(n=t,t=0,r=this.length):"string"==typeof r&&(n=r,r=this.length),1===e.length){var o=e.charCodeAt(0);o<256&&(e=o)}if(void 0!==n&&"string"!=typeof n)throw new TypeError("encoding must be a string");if("string"==typeof n&&!c.isEncoding(n))throw new TypeError("Unknown encoding: "+n)}else"number"==typeof e&&(e&=255);if(t<0||this.length<t||this.length<r)throw new RangeError("Out of range index");if(r<=t)return this;var i;if(t>>>=0,r=void 0===r?this.length:r>>>0,e||(e=0),"number"==typeof e)for(i=t;i<r;++i)this[i]=e;else{var s=c.isBuffer(e)?e:j(new c(e,n).toString()),a=s.length;for(i=0;i<r-t;++i)this[i+t]=s[i%a]}return this};var N=/[^+\/0-9A-Za-z-_]/g;function M(e){return e<16?"0"+e.toString(16):e.toString(16)}function j(e,t){var r;t=t||1/0;for(var n=e.length,o=null,i=[],s=0;s<n;++s){if((r=e.charCodeAt(s))>55295&&r<57344){if(!o){if(r>56319){(t-=3)>-1&&i.push(239,191,189);continue}if(s+1===n){(t-=3)>-1&&i.push(239,191,189);continue}o=r;continue}if(r<56320){(t-=3)>-1&&i.push(239,191,189),o=r;continue}r=65536+(o-55296<<10|r-56320)}else o&&(t-=3)>-1&&i.push(239,191,189);if(o=null,r<128){if((t-=1)<0)break;i.push(r)}else if(r<2048){if((t-=2)<0)break;i.push(r>>6|192,63&r|128)}else if(r<65536){if((t-=3)<0)break;i.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;i.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return i}function V(e){return n.toByteArray(function(e){if((e=function(e){return e.trim?e.trim():e.replace(/^\s+|\s+$/g,"")}(e).replace(N,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function Y(e,t,r,n){for(var o=0;o<n&&!(o+r>=t.length||o>=e.length);++o)t[o+r]=e[o];return o}}).call(this,r(12))},function(e,t,r){"use strict";const n=r(5),o=r(21),i=r(6),s=r(7);t.Key=n,t.MemoryDatastore=o,t.utils=i,t.Errors=s},function(e,t,r){"use strict";(function(n){t.log=function(...e){return"object"==typeof console&&console.log&&console.log(...e)},t.formatArgs=function(t){if(t[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+t[0]+(this.useColors?"%c ":" ")+"+"+e.exports.humanize(this.diff),!this.useColors)return;const r="color: "+this.color;t.splice(1,0,r,"color: inherit");let n=0,o=0;t[0].replace(/%[a-zA-Z%]/g,e=>{"%%"!==e&&(n++,"%c"===e&&(o=n))}),t.splice(o,0,r)},t.save=function(e){try{e?t.storage.setItem("debug",e):t.storage.removeItem("debug")}catch(r){}},t.load=function(){let e;try{e=t.storage.getItem("debug")}catch(r){}!e&&void 0!==n&&"env"in n&&(e={npm_config_save_dev:"",npm_config_legacy_bundling:"",npm_config_dry_run:"",npm_package_engines_npm:">=6.0.0",NVM_INC:"/Users/hugomrdias/.nvm/versions/node/v12.16.2/include/node",npm_config_viewer:"man",npm_config_only:"",npm_config_commit_hooks:"true",npm_config_browser:"",npm_package_gitHead:"0ed316a9429465d997e19f3fcf4b404babdf81b0",npm_config_also:"",npm_package_dependencies_datastore_fs:"^1.0.0",npm_config_sign_git_commit:"",npm_config_rollback:"true",TERM_PROGRAM:"vscode",NODE:"/Users/hugomrdias/.nvm/versions/node/v12.16.2/bin/node",npm_config_usage:"",npm_config_audit:"true",INIT_CWD:"/Users/hugomrdias/code/pl/js-ipfs-repo-migrations",npm_package_devDependencies_sinon:"^7.5.0",npm_package_homepage:"https://github.com/ipfs/js-ipfs-repo-migrations",NVM_CD_FLAGS:"-q",npm_config_globalignorefile:"/Users/hugomrdias/.nvm/versions/node/v12.16.2/etc/npmignore",TERM:"xterm-256color",SHELL:"/usr/local/bin/zsh",npm_config_shell:"/usr/local/bin/zsh",npm_config_maxsockets:"50",npm_config_init_author_url:"",npm_package_devDependencies_rimraf:"^3.0.0",npm_config_shrinkwrap:"true",npm_config_parseable:"",npm_config_metrics_registry:"https://registry.npmjs.org/",TMPDIR:"/var/folders/q9/wc5vzv2n1z310y7_l9kxmynh0000gn/T/",npm_config_timing:"",npm_config_init_license:"ISC",npm_package_scripts_release:'aegir release --docs "--test" "false"',npm_package_scripts_lint:"aegir lint",npm_config_if_present:"",npm_package_dependencies_debug:"^4.1.0",TERM_PROGRAM_VERSION:"1.44.2",npm_config_sign_git_tag:"",npm_config_init_author_email:"",npm_config_cache_max:"Infinity",npm_package_devDependencies_aegir:"^21.9.0",npm_config_preid:"",npm_config_long:"",npm_config_local_address:"",npm_config_git_tag_version:"true",npm_config_cert:"",TERM_SESSION_ID:"w0t0p0:98138C1A-D55C-4A82-ACCA-9E98F9317D98",npm_config_registry:"https://registry.npmjs.org/",npm_config_noproxy:"",npm_config_fetch_retries:"2",npm_package_repository_url:"git+https://github.com/ipfs/js-ipfs-repo-migrations.git",ZSH:"/Users/hugomrdias/.oh-my-zsh",npm_config_versions:"",npm_config_message:"%s",npm_config_key:"",npm_package_readmeFilename:"README.md",npm_package_description:"Migration framework for versioning of JS IPFS Repo",USER:"hugomrdias",NVM_DIR:"/Users/hugomrdias/.nvm",N_PREFIX:"/Users/hugomrdias/n",npm_package_license:"MIT",npm_config_globalconfig:"/Users/hugomrdias/.nvm/versions/node/v12.16.2/etc/npmrc",npm_config_prefer_online:"",npm_config_logs_max:"10",npm_config_always_auth:"",npm_package_scripts_test_node:"aegir test --target node",SSH_AUTH_SOCK:"/private/tmp/com.apple.launchd.EVUVYqPELq/Listeners",npm_package_dependencies_buffer:"^5.6.0",__CF_USER_TEXT_ENCODING:"0x1F5:0x0:0x0",npm_execpath:"/Users/hugomrdias/.nvm/versions/node/v12.16.2/lib/node_modules/npm/bin/npm-cli.js",npm_config_global_style:"",npm_config_cache_lock_retries:"10",npm_package_scripts_coverage:"aegir coverage",npm_config_update_notifier:"true",npm_config_cafile:"",FZF_DEFAULT_OPTS:"--bind='ctrl-o:execute(code {})+abort'",PAGER:"less",VIRTUAL_ENV_DISABLE_PROMPT:"12",npm_config_heading:"npm",npm_config_audit_level:"low",LSCOLORS:"Gxfxcxdxbxegedabagacad",npm_config_searchlimit:"20",npm_config_read_only:"",npm_config_offline:"",npm_config_fetch_retry_mintimeout:"10000",npm_package_dependencies_interface_datastore:"~0.8.3",npm_config_json:"",npm_config_access:"",npm_config_argv:'{"remain":["--test","false"],"cooked":["run","release","--","--test","false"],"original":["run","release","--","--test","false"]}',AEGIR_GHTOKEN:"981983bbbc2ca7e6e69ab0ba31d03c93f0a331f9",PATH:"/Users/hugomrdias/code/pl/js-ipfs-repo-migrations/node_modules/aegir/node_modules/.bin:/Users/hugomrdias/code/pl/js-ipfs-repo-migrations/node_modules/node_modules/.bin:/Users/hugomrdias/code/pl/js-ipfs-repo-migrations/node_modules/.bin:/Users/hugomrdias/code/pl/node_modules/.bin:/Users/hugomrdias/code/node_modules/.bin:/Users/hugomrdias/node_modules/.bin:/Users/node_modules/.bin:/node_modules/.bin:/Users/hugomrdias/.nvm/versions/node/v12.16.2/bin:/Users/hugomrdias/.nvm/versions/node/v12.16.2/lib/node_modules/npm/node_modules/npm-lifecycle/node-gyp-bin:/Users/hugomrdias/code/pl/js-ipfs-repo-migrations/node_modules/.bin:/Users/hugomrdias/.nvm/versions/node/v12.16.2/bin:/usr/local/opt/openssl/bin:/usr/local/sbin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:~/bin",npm_config_allow_same_version:"",npm_package_contributors_1_email:"hugomrdias@gmail.com",npm_config_https_proxy:"",npm_config_engine_strict:"",npm_config_description:"true",_:"/Users/hugomrdias/code/pl/js-ipfs-repo-migrations/node_modules/.bin/aegir",LaunchInstanceID:"BF153338-6DC4-49D0-94E9-B43421ED836B",npm_config_userconfig:"/Users/hugomrdias/.npmrc",npm_config_init_module:"/Users/hugomrdias/.npm-init.js",npm_config_cidr:"",npm_package_dependencies_yargs:"^14.2.0",PWD:"/Users/hugomrdias/code/pl/js-ipfs-repo-migrations",npm_config_user:"501",npm_config_node_version:"12.16.2",npm_package_bugs_url:"https://github.com/ipfs/js-ipfs-repo-migrations/issues/",npm_lifecycle_event:"release",npm_package_devDependencies_chai:"^4.2.0",npm_package_scripts_release_major:"aegir release --type major --docs",EDITOR:"code",npm_config_save:"true",npm_config_ignore_prepublish:"",npm_config_editor:"code",npm_config_auth_type:"legacy",npm_package_repository_type:"git",npm_package_keywords_0:"IPFS",npm_package_name:"ipfs-repo-migrations",LANG:"en_GB.UTF-8",npm_config_tag:"latest",npm_config_script_shell:"",npm_package_browser___src_repo_lock_js:"./src/repo/lock-memory.js",npm_package_keywords_1:"libp2p",ITERM_PROFILE:"Default",npm_config_progress:"true",npm_config_global:"",npm_config_before:"",npm_package_scripts_build:"aegir build",npm_package_keywords_2:"migrations",npm_config_searchstaleness:"900",npm_config_optional:"true",npm_config_ham_it_up:"",npm_package_contributors_0_email:"adam@uhlir.dev",npm_package_scripts_docs:"aegir docs",XPC_FLAGS:"0x0",npm_config_save_prod:"",npm_config_force:"",npm_config_bin_links:"true",npm_package_scripts_coverage_publish:"aegir-coverage --provider coveralls",npm_package_bin_jsipfs_migrations:"src/cli.js",npm_config_searchopts:"",npm_package_engines_node:">=10.0.0",npm_config_node_gyp:"/Users/hugomrdias/.nvm/versions/node/v12.16.2/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js",npm_config_depth:"Infinity",npm_package_main:"src/index.js",npm_config_sso_poll_frequency:"500",npm_config_rebuild_bundle:"true",npm_package_version:"0.2.0",XPC_SERVICE_NAME:"0",npm_config_unicode:"true",SHLVL:"4",COLORFGBG:"15;0",HOME:"/Users/hugomrdias",npm_config_fetch_retry_maxtimeout:"60000",npm_package_scripts_test:"aegir test",APPLICATION_INSIGHTS_NO_DIAGNOSTIC_CHANNEL:"true",npm_config_tag_version_prefix:"v",npm_config_strict_ssl:"true",npm_config_sso_type:"oauth",npm_config_scripts_prepend_node_path:"warn-only",npm_config_save_prefix:"^",npm_config_loglevel:"notice",npm_config_ca:"",npm_package_devDependencies_ncp:"^2.0.0",npm_package_devDependencies_just_safe_set:"^2.1.0",LC_TERMINAL_VERSION:"3.3.9",npm_config_save_exact:"",npm_config_group:"20",npm_config_fetch_retry_factor:"10",npm_config_dev:"",npm_config_version:"",npm_config_prefer_offline:"",npm_config_cache_lock_stale:"60000",npm_package_browser_datastore_fs:"datastore-idb",npm_config_otp:"",npm_config_cache_min:"10",npm_package_dependencies_chalk:"^4.0.0",ITERM_SESSION_ID:"w0t0p0:98138C1A-D55C-4A82-ACCA-9E98F9317D98",npm_config_searchexclude:"",npm_config_cache:"/Users/hugomrdias/.npm",LOGNAME:"hugomrdias",LESS:"-R",npm_lifecycle_script:'aegir release --docs "--test" "false"',npm_config_color:"true",npm_package_devDependencies_chai_as_promised:"^7.1.1",npm_config_proxy:"",npm_config_package_lock:"true",npm_package_dependencies_proper_lockfile:"^4.1.1",LC_CTYPE:"UTF-8",npm_config_package_lock_only:"",npm_config_fund:"true",FZF_DEFAULT_COMMAND:"fd --type f --hidden --follow --exclude .git",npm_config_save_optional:"",npm_package_scripts_test_browser:"aegir test --target browser",NVM_BIN:"/Users/hugomrdias/.nvm/versions/node/v12.16.2/bin",npm_config_ignore_scripts:"",npm_config_user_agent:"npm/6.14.4 node/v12.16.2 darwin x64",npm_package_devDependencies_dirty_chai:"^2.0.1",npm_config_cache_lock_wait:"10000",npm_package_files_2:"dist",PROMPT_EOL_MARK:"",npm_config_production:"",npm_package_dependencies_datastore_idb:"^1.0.2",npm_package_files_1:"src",LC_TERMINAL:"iTerm2",npm_config_send_metrics:"",npm_config_save_bundle:"",npm_package_files_0:"migrations",npm_config_umask:"0022",npm_config_node_options:"",npm_config_init_version:"1.0.0",npm_package_contributors_0_name:"Adam Uhlíř",npm_config_init_author_name:"",npm_config_git:"git",npm_config_scope:"",npm_package_scripts_new_migration:"./src/cli.js add",SECURITYSESSIONID:"186a6",npm_config_unsafe_perm:"true",npm_config_tmp:"/var/folders/q9/wc5vzv2n1z310y7_l9kxmynh0000gn/T",npm_config_onload_script:"",npm_node_execpath:"/Users/hugomrdias/.nvm/versions/node/v12.16.2/bin/node",npm_config_prefix:"/Users/hugomrdias/.nvm/versions/node/v12.16.2",npm_config_link:"",npm_config_format_package_lock:"true",npm_package_contributors_1_name:"Hugo Dias",npm_package_dependencies_yargs_promise:"^1.1.0",npm_package_scripts_release_minor:"aegir release --type minor --docs",COLORTERM:"truecolor",NODE_ENV:"production"}.DEBUG);return e},t.useColors=function(){if("undefined"!=typeof window&&window.process&&("renderer"===window.process.type||window.process.__nwjs))return!0;if("undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))return!1;return"undefined"!=typeof document&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||"undefined"!=typeof window&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)},t.storage=function(){try{return localStorage}catch(e){}}(),t.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"],e.exports=r(26)(t);const{formatters:o}=e.exports;o.j=function(e){try{return JSON.stringify(e)}catch(t){return"[UnexpectedJSONParseError]: "+t.message}}}).call(this,r(25))},function(e,t,r){"use strict";class n extends Error{constructor(e){super(e),this.name="NonReversibleMigrationError",this.code="ERR_NON_REVERSIBLE_MIGRATION",this.message=e}}n.code="ERR_NON_REVERSIBLE_MIGRATION",t.NonReversibleMigrationError=n;class o extends Error{constructor(e){super(e),this.name="NotInitializedRepoError",this.code="ERR_NOT_INITIALIZED_REPO",this.message=e}}o.code="ERR_NOT_INITIALIZED_REPO",t.NotInitializedRepoError=o;class i extends Error{constructor(e){super(e),this.name="RequiredParameterError",this.code="ERR_REQUIRED_PARAMETER",this.message=e}}i.code="ERR_REQUIRED_PARAMETER",t.RequiredParameterError=i;class s extends Error{constructor(e){super(e),this.name="InvalidValueError",this.code="ERR_INVALID_VALUE",this.message=e}}s.code="ERR_INVALID_VALUE",t.InvalidValueError=s},function(e,t,r){"use strict";function n(e){return new i(e)}function o(e){var t,r;function n(t,r){try{var s=e[t](r),a=s.value,c=a instanceof i;Promise.resolve(c?a.wrapped:a).then((function(e){c?n("return"===t?"return":"next",e):o(s.done?"return":"normal",e)}),(function(e){n("throw",e)}))}catch(u){o("throw",u)}}function o(e,o){switch(e){case"return":t.resolve({value:o,done:!0});break;case"throw":t.reject(o);break;default:t.resolve({value:o,done:!1})}(t=t.next)?n(t.key,t.arg):r=null}this._invoke=function(e,o){return new Promise((function(i,s){var a={key:e,arg:o,resolve:i,reject:s,next:null};r?r=r.next=a:(t=r=a,n(e,o))}))},"function"!=typeof e.return&&(this.return=void 0)}function i(e){this.wrapped=e}"function"==typeof Symbol&&Symbol.asyncIterator&&(o.prototype[Symbol.asyncIterator]=function(){return this}),o.prototype.next=function(e){return this._invoke("next",e)},o.prototype.throw=function(e){return this._invoke("throw",e)},o.prototype.return=function(e){return this._invoke("return",e)};const{Buffer:s}=r(0),{openDB:a,deleteDB:c}=r(17),{Key:u,Errors:f,utils:l}=r(1),{filter:p,sortAll:h}=l,g=e=>{if((e=>e instanceof Int8Array||e instanceof Int16Array||e instanceof Int32Array||e instanceof Uint8Array||e instanceof Uint8ClampedArray||e instanceof Uint16Array||e instanceof Uint32Array||e instanceof Float32Array||e instanceof Float64Array)(e)){let t=s.from(e.buffer);return e.byteLength!==e.buffer.byteLength&&(t=t.slice(e.byteOffset,e.byteOffset+e.byteLength)),t}return s.from(e)},_=e=>{const t=new ArrayBuffer(e.length),r=new Uint8Array(t);for(let n=0,o=e.length;n<o;n++)r[n]=e.charCodeAt(n);return t},d=function(){var e,t=(e=function*(e,t,r){const o=e.prefix?self.IDBKeyRange.bound(_(e.prefix),_(e.prefix+"ÿ"),!1,!0):void 0;let i=yield n(t.transaction(r).store.openCursor(o)),a=0;for(i&&e.offset&&e.offset>0&&(i=yield n(i.advance(e.offset)));i;){if(void 0!==e.limit&&e.limit===a)return;a++;const t=new u(s.from(i.key));if(e.keysOnly)yield{key:t};else{const e=s.from(i.value);yield{key:t,value:e}}i=yield n(i.continue())}},function(){return new o(e.apply(this,arguments))});return function(e,r,n){return t.apply(this,arguments)}}();e.exports=class{constructor(e,t={}){this.store=null,this.options=t,this.location=t.prefix+e,this.version=t.version||1}async open(){if(null!==this.store)return;const e=this.location;try{this.store=await a(this.location,this.version,{upgrade(t){t.createObjectStore(e)}})}catch(t){throw f.dbOpenFailedError(t)}}async put(e,t){if(null===this.store)throw new Error("Datastore needs to be opened.");try{await this.store.put(this.location,t,e.toBuffer())}catch(r){throw f.dbWriteFailedError(r)}}async get(e){if(null===this.store)throw new Error("Datastore needs to be opened.");let t;try{t=await this.store.get(this.location,e.toBuffer())}catch(r){throw f.dbWriteFailedError(r)}if(!t)throw f.notFoundError();return g(t)}async has(e){if(null===this.store)throw new Error("Datastore needs to be opened.");try{await this.get(e)}catch(t){if("ERR_NOT_FOUND"===t.code)return!1;throw t}return!0}async delete(e){if(null===this.store)throw new Error("Datastore needs to be opened.");try{await this.store.delete(this.location,e.toBuffer())}catch(t){throw f.dbDeleteFailedError(t)}}batch(){const e=[],t=[];return{put(t,r){e.push([t.toBuffer(),r])},delete(e){t.push(e.toBuffer())},commit:async()=>{if(null===this.store)throw new Error("Datastore needs to be opened.");const r=this.store.transaction(this.location,"readwrite"),n=r.store;await Promise.all(e.map(e=>n.put(e[1],e[0]))),await Promise.all(t.map(e=>n.delete(e))),await r.done}}}query(e){if(null===this.store)throw new Error("Datastore needs to be opened.");let t=d(e,this.store,this.location);return Array.isArray(e.filters)&&(t=e.filters.reduce((e,t)=>p(e,t),t)),Array.isArray(e.orders)&&(t=e.orders.reduce((e,t)=>h(e,t),t)),t}close(){if(null===this.store)throw new Error("Datastore needs to be opened.");this.store.close(),this.store=null}destroy(){return c(this.location)}}},function(e,t,r){"use strict";const{Buffer:n}=r(0),{nanoid:o}=r(19),i=r(20),s=n.from("/"),a=s[0];class c{constructor(e,t){if("string"==typeof e?this._buf=n.from(e):n.isBuffer(e)&&(this._buf=e),null==t&&(t=!0),t&&this.clean(),0===this._buf.length||this._buf[0]!==a)throw new Error("Invalid key")}toString(e){return this._buf.toString(e||"utf8")}toBuffer(){return this._buf}get[Symbol.toStringTag](){return"[Key ".concat(this.toString(),"]")}static withNamespaces(e){return new u(e.join("/"))}static random(){return new u(o().replace(/-/g,""))}clean(){for(this._buf&&0!==this._buf.length||(this._buf=n.from("/")),this._buf[0]!==a&&(this._buf=n.concat([s,this._buf]));this._buf.length>1&&this._buf[this._buf.length-1]===a;)this._buf=this._buf.slice(0,-1)}less(e){const t=this.list(),r=e.list();for(let n=0;n<t.length;n++){if(r.length<n+1)return!1;const e=t[n],o=r[n];if(e<o)return!0;if(e>o)return!1}return t.length<r.length}reverse(){return c.withNamespaces(this.list().slice().reverse())}namespaces(){return this.list()}baseNamespace(){const e=this.namespaces();return e[e.length-1]}list(){return this.toString().split("/").slice(1)}type(){return function(e){const t=e.split(":");if(t.length<2)return"";return t.slice(0,-1).join(":")}(this.baseNamespace())}name(){return function(e){const t=e.split(":");return t[t.length-1]}(this.baseNamespace())}instance(e){return new u(this.toString()+":"+e)}path(){let e=this.parent().toString();return e.endsWith("/")||(e+="/"),e+=this.type(),new u(e)}parent(){const e=this.list();return 1===e.length?new u("/"):new u(e.slice(0,-1).join("/"))}child(e){return"/"===this.toString()?e:"/"===e.toString()?this:new u(this.toString()+e.toString(),!1)}isAncestorOf(e){return e.toString()!==this.toString()&&e.toString().startsWith(this.toString())}isDecendantOf(e){return e.toString()!==this.toString()&&this.toString().startsWith(e.toString())}isTopLevel(){return 1===this.list().length}concat(...e){return c.withNamespaces([...this.namespaces(),...(t=e.map(e=>e.namespaces()),[].concat(...t))]);var t}}const u=i(c,{className:"Key",symbolName:"@ipfs/interface-datastore/key"});e.exports=u},function(e,t,r){"use strict";function n(e){return new s(e)}function o(e){return function(){return new i(e.apply(this,arguments))}}function i(e){var t,r;function n(t,r){try{var i=e[t](r),a=i.value,c=a instanceof s;Promise.resolve(c?a.wrapped:a).then((function(e){c?n("return"===t?"return":"next",e):o(i.done?"return":"normal",e)}),(function(e){n("throw",e)}))}catch(u){o("throw",u)}}function o(e,o){switch(e){case"return":t.resolve({value:o,done:!0});break;case"throw":t.reject(o);break;default:t.resolve({value:o,done:!1})}(t=t.next)?n(t.key,t.arg):r=null}this._invoke=function(e,o){return new Promise((function(i,s){var a={key:e,arg:o,resolve:i,reject:s,next:null};r?r=r.next=a:(t=r=a,n(e,o))}))},"function"!=typeof e.return&&(this.return=void 0)}function s(e){this.wrapped=e}function a(e){var t;if("undefined"!=typeof Symbol){if(Symbol.asyncIterator&&null!=(t=e[Symbol.asyncIterator]))return t.call(e);if(Symbol.iterator&&null!=(t=e[Symbol.iterator]))return t.call(e)}throw new TypeError("Object is not async iterable")}"function"==typeof Symbol&&Symbol.asyncIterator&&(i.prototype[Symbol.asyncIterator]=function(){return this}),i.prototype.next=function(e){return this._invoke("next",e)},i.prototype.throw=function(e){return this._invoke("throw",e)},i.prototype.return=function(e){return this._invoke("return",e)};const c=r(22);t.filter=(e,t)=>o((function*(){var r,o=!0,i=!1;try{for(var s,c,u=a(e);o=(s=yield n(u.next())).done,c=yield n(s.value),!o;o=!0){const e=c;(yield n(t(e)))&&(yield e)}}catch(f){i=!0,r=f}finally{try{o||null==u.return||(yield n(u.return()))}finally{if(i)throw r}}}))(),t.sortAll=(e,t)=>o((function*(){let r=[];var o,i=!0,s=!1;try{for(var c,u,f=a(e);i=(c=yield n(f.next())).done,u=yield n(c.value),!i;i=!0){const e=u;r.push(e)}}catch(l){s=!0,o=l}finally{try{i||null==f.return||(yield n(f.return()))}finally{if(s)throw o}}r=yield n(t(r));for(const e of r)yield e}))(),t.take=(e,t)=>o((function*(){if(t<=0)return;let r=0;var o,i=!0,s=!1;try{for(var c,u,f=a(e);i=(c=yield n(f.next())).done,u=yield n(c.value),!i;i=!0){const e=u;if(yield e,r++,r>=t)return}}catch(l){s=!0,o=l}finally{try{i||null==f.return||(yield n(f.return()))}finally{if(s)throw o}}}))(),t.map=(e,t)=>o((function*(){var r,o=!0,i=!1;try{for(var s,c,u=a(e);o=(s=yield n(u.next())).done,c=yield n(s.value),!o;o=!0){const e=c;yield t(e)}}catch(f){i=!0,r=f}finally{try{o||null==u.return||(yield n(u.return()))}finally{if(i)throw r}}}))(),t.replaceStartWith=function(e,t){const r=new RegExp("^"+t);return e.replace(r,"")},t.tmpdir=c},function(e,t,r){"use strict";const n=r(24);e.exports.dbOpenFailedError=e=>(e=e||new Error("Cannot open database"),n(e,"ERR_DB_OPEN_FAILED")),e.exports.dbDeleteFailedError=e=>(e=e||new Error("Delete failed"),n(e,"ERR_DB_DELETE_FAILED")),e.exports.dbWriteFailedError=e=>(e=e||new Error("Write failed"),n(e,"ERR_DB_WRITE_FAILED")),e.exports.notFoundError=e=>(e=e||new Error("Not Found"),n(e,"ERR_NOT_FOUND"))},function(e,t,r){e.exports=r(9)},function(e,t,r){"use strict";const n=r(10),o=r(11),i=r(28),s=r(3),a=r(2)("repo-migrations:migrator");function c(e){return e=e||n,Array.isArray(e)&&0!==e.length?e[e.length-1].version:0}function u(e,t,r,n=!1){let o=0;for(const i of e){if(i.version>r)break;if(i.version>t){if(n&&!i.revert)throw new s.NonReversibleMigrationError("It is not possible to revert to version ".concat(t," because migration version ").concat(i.version," is not reversible. Cancelling reversion."));o++}}if(o!==r-t)throw new s.InvalidValueError("The ipfs-repo-migrations package does not have all migration to migrate from version ".concat(t," to ").concat(r))}t.getCurrentRepoVersion=o.getVersion,t.errors=s,t.getLatestMigrationVersion=c,t.migrate=async function(e,t,{ignoreLock:r=!1,repoOptions:f,onProgress:l,isDryRun:p=!1,migrations:h}){if(h=h||n,l=l||(()=>{}),!e)throw new s.RequiredParameterError("Path argument is required!");if(!t)throw new s.RequiredParameterError("toVersion argument is required!");if(!Number.isInteger(t)||t<=0)throw new s.InvalidValueError("Version has to be positive integer!");const g=await o.getVersion(e);if(g===t)return void a("Nothing to migrate.");if(g>t)throw new s.InvalidValueError("Current repo's version (".concat(g,") is higher then toVersion (").concat(t,"), you probably wanted to revert it?"));let _;u(h,g,t),p||r||(_=await i.lock(g,e));try{let n=0;const i=t-g;for(const r of h){if(void 0!==t&&r.version>t)break;if(!(r.version<=g)){n++,a("Migrating version ".concat(r.version));try{p||await r.migrate(e,f)}catch(d){const t=r.version-1;throw a("An exception was raised during execution of migration. Setting the repo's version to last successfully migrated version: ".concat(t)),await o.setVersion(e,t),d.message="During migration to version ".concat(r.version," exception was raised: ").concat(d.message),d}l(r,n,i),a("Migrating to version ".concat(r.version," finished"))}}p||await o.setVersion(e,t||c(h)),a("Repo successfully migrated ",void 0!==t?"to version ".concat(t,"!"):"to latest version!")}finally{p||r||await _.close()}},t.revert=async function(e,t,{ignoreLock:r=!1,repoOptions:c,onProgress:f,isDryRun:l=!1,migrations:p}){if(p=p||n,f=f||(()=>{}),!e)throw new s.RequiredParameterError("Path argument is required!");if(!t)throw new s.RequiredParameterError("When reverting migrations, you have to specify to which version to revert!");if(!Number.isInteger(t)||t<=0)throw new s.InvalidValueError("Version has to be positive integer!");const h=await o.getVersion(e);if(h===t)return void a("Nothing to revert.");if(h<t)throw new s.InvalidValueError("Current repo's version (".concat(h,") is lower then toVersion (").concat(t,"), you probably wanted to migrate it?"));let g;u(p,t,h,!0),l||r||(g=await i.lock(h,e)),a("Reverting from version ".concat(h," to ").concat(t));try{let n=0;const i=h-t,s=p.slice().reverse();for(const r of s){if(r.version<=t)break;if(!(r.version>h)){n++,a("Reverting migration version ".concat(r.version));try{l||await r.revert(e,c)}catch(_){const t=r.version;throw a("An exception was raised during execution of migration. Setting the repo's version to last successfully reverted version: ".concat(t)),await o.setVersion(e,t),_.message="During reversion to version ".concat(r.version," exception was raised: ").concat(_.message),_}f(r,n,i),a("Reverting to version ".concat(r.version," finished"))}}l||await o.setVersion(e,t),a("All migrations successfully reverted to version ".concat(t,"!"))}finally{l||r||await g.close()}}},function(e,t,r){"use strict";const n={description:"Empty migration.",migrate:()=>{},revert:()=>{},empty:!0};e.exports=[Object.assign({},n,{version:7,revert:void 0}),Object.assign({},n,{version:6,revert:void 0}),Object.assign({},n,{version:5,revert:void 0}),Object.assign({},n,{version:4,revert:void 0}),Object.assign({},n,{version:3,revert:void 0}),Object.assign({},n,{version:2,revert:void 0}),Object.assign({},n,{version:1,revert:void 0})]},function(e,t,r){"use strict";const{Buffer:n}=r(0),o=r(3),i=r(16),s=r(4),a=new(0,r(1).Key)("version");t.getVersion=async function(e){if(!await i.isRepoInitialized(e))throw new o.NotInitializedRepoError("Repo in path ".concat(e," is not initialized!"));const t=new s(e,{extension:"",createIfMissing:!1});await t.open();const r=parseInt(await t.get(a));return await t.close(),r},t.setVersion=async function(e,t){const r=new s(e,{extension:"",createIfMissing:!1});await r.open(),await r.put(a,n.from(String(t))),await r.close()}},function(e,t,r){"use strict";var n;n=function(){return this}();try{n=n||new Function("return this")()}catch(o){"object"==typeof window&&(n=window)}e.exports=n},function(e,t,r){"use strict";t.byteLength=function(e){var t=u(e),r=t[0],n=t[1];return 3*(r+n)/4-n},t.toByteArray=function(e){var t,r,n=u(e),s=n[0],a=n[1],c=new i(function(e,t,r){return 3*(t+r)/4-r}(0,s,a)),f=0,l=a>0?s-4:s;for(r=0;r<l;r+=4)t=o[e.charCodeAt(r)]<<18|o[e.charCodeAt(r+1)]<<12|o[e.charCodeAt(r+2)]<<6|o[e.charCodeAt(r+3)],c[f++]=t>>16&255,c[f++]=t>>8&255,c[f++]=255&t;2===a&&(t=o[e.charCodeAt(r)]<<2|o[e.charCodeAt(r+1)]>>4,c[f++]=255&t);1===a&&(t=o[e.charCodeAt(r)]<<10|o[e.charCodeAt(r+1)]<<4|o[e.charCodeAt(r+2)]>>2,c[f++]=t>>8&255,c[f++]=255&t);return c},t.fromByteArray=function(e){for(var t,r=e.length,o=r%3,i=[],s=0,a=r-o;s<a;s+=16383)i.push(f(e,s,s+16383>a?a:s+16383));1===o?(t=e[r-1],i.push(n[t>>2]+n[t<<4&63]+"==")):2===o&&(t=(e[r-2]<<8)+e[r-1],i.push(n[t>>10]+n[t>>4&63]+n[t<<2&63]+"="));return i.join("")};for(var n=[],o=[],i="undefined"!=typeof Uint8Array?Uint8Array:Array,s="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",a=0,c=s.length;a<c;++a)n[a]=s[a],o[s.charCodeAt(a)]=a;function u(e){var t=e.length;if(t%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var r=e.indexOf("=");return-1===r&&(r=t),[r,r===t?0:4-r%4]}function f(e,t,r){for(var o,i,s=[],a=t;a<r;a+=3)o=(e[a]<<16&16711680)+(e[a+1]<<8&65280)+(255&e[a+2]),s.push(n[(i=o)>>18&63]+n[i>>12&63]+n[i>>6&63]+n[63&i]);return s.join("")}o["-".charCodeAt(0)]=62,o["_".charCodeAt(0)]=63},function(e,t,r){"use strict";t.read=function(e,t,r,n,o){var i,s,a=8*o-n-1,c=(1<<a)-1,u=c>>1,f=-7,l=r?o-1:0,p=r?-1:1,h=e[t+l];for(l+=p,i=h&(1<<-f)-1,h>>=-f,f+=a;f>0;i=256*i+e[t+l],l+=p,f-=8);for(s=i&(1<<-f)-1,i>>=-f,f+=n;f>0;s=256*s+e[t+l],l+=p,f-=8);if(0===i)i=1-u;else{if(i===c)return s?NaN:1/0*(h?-1:1);s+=Math.pow(2,n),i-=u}return(h?-1:1)*s*Math.pow(2,i-n)},t.write=function(e,t,r,n,o,i){var s,a,c,u=8*i-o-1,f=(1<<u)-1,l=f>>1,p=23===o?Math.pow(2,-24)-Math.pow(2,-77):0,h=n?0:i-1,g=n?1:-1,_=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(a=isNaN(t)?1:0,s=f):(s=Math.floor(Math.log(t)/Math.LN2),t*(c=Math.pow(2,-s))<1&&(s--,c*=2),(t+=s+l>=1?p/c:p*Math.pow(2,1-l))*c>=2&&(s++,c/=2),s+l>=f?(a=0,s=f):s+l>=1?(a=(t*c-1)*Math.pow(2,o),s+=l):(a=t*Math.pow(2,l-1)*Math.pow(2,o),s=0));o>=8;e[r+h]=255&a,h+=g,a/=256,o-=8);for(s=s<<o|a,u+=o;u>0;e[r+h]=255&s,h+=g,s/=256,u-=8);e[r+h-g]|=128*_}},function(e,t,r){"use strict";var n={}.toString;e.exports=Array.isArray||function(e){return"[object Array]"==n.call(e)}},function(e,t,r){"use strict";const n=r(4),o=r(2)("repo-migrations:repo:init"),i=r(1).Key,s=new i("/version"),a=new i("/config");t.isRepoInitialized=async function(e){let t;try{t=new n(e,{extension:"",createIfMissing:!1}),await t.open();const r=await t.has(s),i=await t.has(a);return!(!r||!i)||(o("Version entry present: ".concat(r)),o("Config entry present: ".concat(i)),!1)}catch(r){return o("While checking if repo is initialized error was thrown: "+r.message),!1}finally{void 0!==t&&await t.close()}}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.deleteDB=function(e,{blocked:t}={}){const r=indexedDB.deleteDatabase(e);t&&r.addEventListener("blocked",()=>t());return(0,n.w)(r).then(()=>{})},t.openDB=function(e,t,{blocked:r,upgrade:o,blocking:i,terminated:s}={}){const a=indexedDB.open(e,t),c=(0,n.w)(a);o&&a.addEventListener("upgradeneeded",e=>{o((0,n.w)(a.result),e.oldVersion,e.newVersion,(0,n.w)(a.transaction))});r&&a.addEventListener("blocked",()=>r());return c.then(e=>{s&&e.addEventListener("close",()=>s()),i&&e.addEventListener("versionchange",()=>i())}).catch(()=>{}),c},Object.defineProperty(t,"unwrap",{enumerable:!0,get:function(){return n.u}}),Object.defineProperty(t,"wrap",{enumerable:!0,get:function(){return n.w}});var n=r(18);function o(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function i(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const s=["get","getKey","getAll","getAllKeys","count"],a=["put","add","delete","clear"],c=new Map;function u(e,t){if(!(e instanceof IDBDatabase)||t in e||"string"!=typeof t)return;if(c.get(t))return c.get(t);const r=t.replace(/FromIndex$/,""),n=t!==r,o=a.includes(r);if(!(r in(n?IDBIndex:IDBObjectStore).prototype)||!o&&!s.includes(r))return;const i=async function(e,...t){const i=this.transaction(e,o?"readwrite":"readonly");let s=i.store;n&&(s=s.index(t.shift()));const a=s[r](...t);return o&&await i.done,a};return c.set(t,i),i}(0,n.r)(e=>function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?o(Object(r),!0).forEach((function(t){i(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):o(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}({},e,{get:(t,r,n)=>u(t,r)||e.get(t,r,n),has:(t,r)=>!!u(t,r)||e.has(t,r)}))},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.r=function(e){l=e(l)},t.w=g,t.u=t.i=t.a=void 0;const n=(e,t)=>t.some(t=>e instanceof t);let o,i;t.i=n;const s=new WeakMap,a=new WeakMap,c=new WeakMap,u=new WeakMap,f=new WeakMap;t.a=f;let l={get(e,t,r){if(e instanceof IDBTransaction){if("done"===t)return a.get(e);if("objectStoreNames"===t)return e.objectStoreNames||c.get(e);if("store"===t)return r.objectStoreNames[1]?void 0:r.objectStore(r.objectStoreNames[0])}return g(e[t])},set:(e,t,r)=>(e[t]=r,!0),has:(e,t)=>e instanceof IDBTransaction&&("done"===t||"store"===t)||t in e};function p(e){return e!==IDBDatabase.prototype.transaction||"objectStoreNames"in IDBTransaction.prototype?(i||(i=[IDBCursor.prototype.advance,IDBCursor.prototype.continue,IDBCursor.prototype.continuePrimaryKey])).includes(e)?function(...t){return e.apply(_(this),t),g(s.get(this))}:function(...t){return g(e.apply(_(this),t))}:function(t,...r){const n=e.call(_(this),t,...r);return c.set(n,t.sort?t.sort():[t]),g(n)}}function h(e){return"function"==typeof e?p(e):(e instanceof IDBTransaction&&function(e){if(a.has(e))return;const t=new Promise((t,r)=>{const n=()=>{e.removeEventListener("complete",o),e.removeEventListener("error",i),e.removeEventListener("abort",i)},o=()=>{t(),n()},i=()=>{r(e.error||new DOMException("AbortError","AbortError")),n()};e.addEventListener("complete",o),e.addEventListener("error",i),e.addEventListener("abort",i)});a.set(e,t)}(e),n(e,o||(o=[IDBDatabase,IDBObjectStore,IDBIndex,IDBCursor,IDBTransaction]))?new Proxy(e,l):e)}function g(e){if(e instanceof IDBRequest)return function(e){const t=new Promise((t,r)=>{const n=()=>{e.removeEventListener("success",o),e.removeEventListener("error",i)},o=()=>{t(g(e.result)),n()},i=()=>{r(e.error),n()};e.addEventListener("success",o),e.addEventListener("error",i)});return t.then(t=>{t instanceof IDBCursor&&s.set(t,e)}).catch(()=>{}),f.set(t,e),t}(e);if(u.has(e))return u.get(e);const t=h(e);return t!==e&&(u.set(e,t),f.set(t,e)),t}const _=e=>f.get(e);t.u=_},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.random=t.urlAlphabet=t.customRandom=t.customAlphabet=t.nanoid=void 0;t.urlAlphabet="ModuleSymbhasOwnPr-0123456789ABCDEFGHNRVfgctiUvz_KqYTJkLxpZXIjQW";let n=e=>crypto.getRandomValues(new Uint8Array(e));t.random=n;let o=(e,t,r)=>{let n=(2<<Math.log(e.length-1)/Math.LN2)-1,o=-~(1.6*n*t/e.length);return()=>{let i="";for(;;){let s=r(o),a=o;for(;a--;)if(i+=e[s[a]&n]||"",i.length===+t)return i}}};t.customRandom=o;t.customAlphabet=(e,t)=>o(e,t,n);t.nanoid=(e=21)=>{let t="",r=crypto.getRandomValues(new Uint8Array(e));for(;e--;){let n=63&r[e];t+=n<36?n.toString(36):n<62?(n-26).toString(36).toUpperCase():n<63?"_":"-"}return t}},function(e,t,r){"use strict";e.exports=function(e,{className:t,symbolName:r}){const n=Symbol.for(r),o={[t]:class extends e{constructor(...e){super(...e),Object.defineProperty(this,n,{value:!0})}get[Symbol.toStringTag](){return t}}}[t];return o["is".concat(t)]=e=>!(!e||!e[n]),o},e.exports.proto=function(e,{className:t,symbolName:r,withoutNew:n}){const o=Symbol.for(r),i={[t]:function(...t){if(n&&!(this instanceof i))return new i(...t);const r=e.call(this,...t)||this;return r&&!r[o]&&Object.defineProperty(r,o,{value:!0}),r}}[t];return i.prototype=Object.create(e.prototype),i.prototype.constructor=i,Object.defineProperty(i.prototype,Symbol.toStringTag,{get:()=>t}),i["is".concat(t)]=e=>!(!e||!e[o]),i}},function(e,t,r){"use strict";const{filter:n,sortAll:o,take:i,map:s}=r(6),a=r(5),c=r(7);e.exports=class{constructor(){this.data={}}async open(){}async put(e,t){this.data[e.toString()]=t}async get(e){if(!await this.has(e))throw c.notFoundError();return this.data[e.toString()]}async has(e){return void 0!==this.data[e.toString()]}async delete(e){delete this.data[e.toString()]}batch(){let e=[],t=[];return{put(t,r){e.push([t,r])},delete(e){t.push(e)},commit:async()=>{e.forEach(e=>{this.data[e[0].toString()]=e[1]}),e=[],t.forEach(e=>{delete this.data[e.toString()]}),t=[]}}}query(e){let t=Object.entries(this.data);if(t=s(t,e=>({key:new a(e[0]),value:e[1]})),null!=e.prefix&&(t=n(t,t=>t.key.toString().startsWith(e.prefix))),Array.isArray(e.filters)&&(t=e.filters.reduce((e,t)=>n(e,t),t)),Array.isArray(e.orders)&&(t=e.orders.reduce((e,t)=>o(e,t),t)),null!=e.offset){let r=0;t=n(t,()=>r++>=e.offset)}return null!=e.limit&&(t=i(t,e.limit)),!0===e.keysOnly&&(t=s(t,e=>({key:e.key}))),t}async close(){}}},function(e,t,r){"use strict";const n=r(23);e.exports=(e=(e=>e))=>e(n())},function(e,t,r){"use strict";for(var n=self.crypto||self.msCrypto,o="-_",i=36;i--;)o+=i.toString(36);for(i=36;i---10;)o+=i.toString(36).toUpperCase();e.exports=function(e){var t="",r=n.getRandomValues(new Uint8Array(e||21));for(i=e||21;i--;)t+=o[63&r[i]];return t}},function(e,t,r){"use strict";e.exports=function(e,t,r){var n;if(!(e instanceof Error))throw new TypeError("Please pass an Error to err-code");if("object"==typeof t?r=t:null!=t&&(e.code=t),r)for(n in r)e[n]=r[n];return e}},function(e,t,r){"use strict";var n,o,i=e.exports={};function s(){throw new Error("setTimeout has not been defined")}function a(){throw new Error("clearTimeout has not been defined")}function c(e){if(n===setTimeout)return setTimeout(e,0);if((n===s||!n)&&setTimeout)return n=setTimeout,setTimeout(e,0);try{return n(e,0)}catch(t){try{return n.call(null,e,0)}catch(t){return n.call(this,e,0)}}}!function(){try{n="function"==typeof setTimeout?setTimeout:s}catch(e){n=s}try{o="function"==typeof clearTimeout?clearTimeout:a}catch(e){o=a}}();var u,f=[],l=!1,p=-1;function h(){l&&u&&(l=!1,u.length?f=u.concat(f):p=-1,f.length&&g())}function g(){if(!l){var e=c(h);l=!0;for(var t=f.length;t;){for(u=f,f=[];++p<t;)u&&u[p].run();p=-1,t=f.length}u=null,l=!1,function(e){if(o===clearTimeout)return clearTimeout(e);if((o===a||!o)&&clearTimeout)return o=clearTimeout,clearTimeout(e);try{o(e)}catch(t){try{return o.call(null,e)}catch(t){return o.call(this,e)}}}(e)}}function _(e,t){this.fun=e,this.array=t}function d(){}i.nextTick=function(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var r=1;r<arguments.length;r++)t[r-1]=arguments[r];f.push(new _(e,t)),1!==f.length||l||c(g)},_.prototype.run=function(){this.fun.apply(null,this.array)},i.title="browser",i.browser=!0,i.env={},i.argv=[],i.version="",i.versions={},i.on=d,i.addListener=d,i.once=d,i.off=d,i.removeListener=d,i.removeAllListeners=d,i.emit=d,i.prependListener=d,i.prependOnceListener=d,i.listeners=function(e){return[]},i.binding=function(e){throw new Error("process.binding is not supported")},i.cwd=function(){return"/"},i.chdir=function(e){throw new Error("process.chdir is not supported")},i.umask=function(){return 0}},function(e,t,r){"use strict";e.exports=function(e){function t(e){let t=0;for(let r=0;r<e.length;r++)t=(t<<5)-t+e.charCodeAt(r),t|=0;return n.colors[Math.abs(t)%n.colors.length]}function n(e){let r;function s(...e){if(!s.enabled)return;const t=s,o=Number(new Date),i=o-(r||o);t.diff=i,t.prev=r,t.curr=o,r=o,e[0]=n.coerce(e[0]),"string"!=typeof e[0]&&e.unshift("%O");let a=0;e[0]=e[0].replace(/%([a-zA-Z%])/g,(r,o)=>{if("%%"===r)return r;a++;const i=n.formatters[o];if("function"==typeof i){const n=e[a];r=i.call(t,n),e.splice(a,1),a--}return r}),n.formatArgs.call(t,e),(t.log||n.log).apply(t,e)}return s.namespace=e,s.enabled=n.enabled(e),s.useColors=n.useColors(),s.color=t(e),s.destroy=o,s.extend=i,"function"==typeof n.init&&n.init(s),n.instances.push(s),s}function o(){const e=n.instances.indexOf(this);return-1!==e&&(n.instances.splice(e,1),!0)}function i(e,t){const r=n(this.namespace+(void 0===t?":":t)+e);return r.log=this.log,r}function s(e){return e.toString().substring(2,e.toString().length-2).replace(/\.\*\?$/,"*")}return n.debug=n,n.default=n,n.coerce=function(e){if(e instanceof Error)return e.stack||e.message;return e},n.disable=function(){const e=[...n.names.map(s),...n.skips.map(s).map(e=>"-"+e)].join(",");return n.enable(""),e},n.enable=function(e){let t;n.save(e),n.names=[],n.skips=[];const r=("string"==typeof e?e:"").split(/[\s,]+/),o=r.length;for(t=0;t<o;t++)r[t]&&("-"===(e=r[t].replace(/\*/g,".*?"))[0]?n.skips.push(new RegExp("^"+e.substr(1)+"$")):n.names.push(new RegExp("^"+e+"$")));for(t=0;t<n.instances.length;t++){const e=n.instances[t];e.enabled=n.enabled(e.namespace)}},n.enabled=function(e){if("*"===e[e.length-1])return!0;let t,r;for(t=0,r=n.skips.length;t<r;t++)if(n.skips[t].test(e))return!1;for(t=0,r=n.names.length;t<r;t++)if(n.names[t].test(e))return!0;return!1},n.humanize=r(27),Object.keys(e).forEach(t=>{n[t]=e[t]}),n.instances=[],n.names=[],n.skips=[],n.formatters={},n.selectColor=t,n.enable(n.load()),n}},function(e,t,r){"use strict";var n=1e3,o=6e4,i=60*o,s=24*i;function a(e,t,r,n){var o=t>=1.5*r;return Math.round(e/r)+" "+n+(o?"s":"")}e.exports=function(e,t){t=t||{};var r=typeof e;if("string"===r&&e.length>0)return function(e){if((e=String(e)).length>100)return;var t=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(e);if(!t)return;var r=parseFloat(t[1]);switch((t[2]||"ms").toLowerCase()){case"years":case"year":case"yrs":case"yr":case"y":return 315576e5*r;case"weeks":case"week":case"w":return 6048e5*r;case"days":case"day":case"d":return r*s;case"hours":case"hour":case"hrs":case"hr":case"h":return r*i;case"minutes":case"minute":case"mins":case"min":case"m":return r*o;case"seconds":case"second":case"secs":case"sec":case"s":return r*n;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return r;default:return}}(e);if("number"===r&&isFinite(e))return t.long?function(e){var t=Math.abs(e);if(t>=s)return a(e,t,s,"day");if(t>=i)return a(e,t,i,"hour");if(t>=o)return a(e,t,o,"minute");if(t>=n)return a(e,t,n,"second");return e+" ms"}(e):function(e){var t=Math.abs(e);if(t>=s)return Math.round(e/s)+"d";if(t>=i)return Math.round(e/i)+"h";if(t>=o)return Math.round(e/o)+"m";if(t>=n)return Math.round(e/n)+"s";return e+"ms"}(e);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(e))}},function(e,t,r){"use strict";const n=r(2)("repo-migrations:repo_mem_lock"),o={};t.lock=async function(e,t){const r=t+"/repo.lock";if(n("locking %s",r),!0===o[r])throw Error("There is already present lock for: ".concat(r));return o[r]=!0,{close(){o[r]&&(n("releasing lock %s",r),delete o[r])}}}}])}));
//# sourceMappingURL=index.min.js.map
{
"name": "ipfs-repo-migrations",
"version": "0.2.0",
"version": "0.2.1",
"description": "Migration framework for versioning of JS IPFS Repo",

@@ -47,6 +47,6 @@ "keywords": [

"dependencies": {
"buffer": "^5.5.0",
"buffer": "^5.6.0",
"chalk": "^4.0.0",
"datastore-fs": "~0.9.1",
"datastore-idb": "^1.0.0",
"datastore-fs": "^1.0.0",
"datastore-idb": "^1.0.2",
"debug": "^4.1.0",

@@ -59,3 +59,3 @@ "interface-datastore": "~0.8.3",

"devDependencies": {
"aegir": "^21.4.5",
"aegir": "^21.9.0",
"chai": "^4.2.0",

@@ -75,4 +75,5 @@ "chai-as-promised": "^7.1.1",

"Adam Uhlíř <adam@uhlir.dev>",
"Hugo Dias <hugomrdias@gmail.com>"
"Hugo Dias <hugomrdias@gmail.com>",
"Hector Sanjuan <code@hector.link>"
]
}

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc