Socket
Socket
Sign inDemoInstall

ipfs-block-service

Package Overview
Dependencies
2
Maintainers
2
Versions
29
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 0.16.0 to 0.17.0

dist/index.min.js.LICENSE.txt

20

CHANGELOG.md

@@ -0,1 +1,21 @@

<a name="0.17.0"></a>
# [0.17.0](https://github.com/ipfs/js-ipfs-block-service/compare/v0.16.0...v0.17.0) (2020-04-16)
### Bug Fixes
* throw if asked to delete a block we don't have ([#88](https://github.com/ipfs/js-ipfs-block-service/issues/88)) ([4ffb28c](https://github.com/ipfs/js-ipfs-block-service/commit/4ffb28c))
### Features
* support passing AbortSignals to the configured repo ([#89](https://github.com/ipfs/js-ipfs-block-service/issues/89)) ([0c5f17c](https://github.com/ipfs/js-ipfs-block-service/commit/0c5f17c))
### BREAKING CHANGES
* `bs.delete(cid)` used to ignore mystery CIDs, now it throws.
<a name="0.16.0"></a>

@@ -2,0 +22,0 @@ # [0.16.0](https://github.com/ipfs/js-ipfs-block-service/compare/v0.15.2...v0.16.0) (2019-06-18)

3

dist/index.min.js

@@ -1,2 +0,3 @@

!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.IpfsBlockService=t():e.IpfsBlockService=t()}(window,function(){return function(e){var t={};function r(n){if(t[n])return t[n].exports;var a=t[n]={i:n,l:!1,exports:{}};return e[n].call(a.exports,a,a.exports,r),a.l=!0,a.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 a in e)r.d(n,a,function(t){return e[t]}.bind(null,a));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=0)}([function(e,t,r){e.exports=r(1)},function(e,t,r){"use strict";function n(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}var a=r(2).map,u=function(){function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this._repo=t,this._bitswap=null}var t,r,u;return t=e,(r=[{key:"setExchange",value:function(e){this._bitswap=e}},{key:"unsetExchange",value:function(){this._bitswap=null}},{key:"hasExchange",value:function(){return null!=this._bitswap}},{key:"put",value:function(e){return this.hasExchange()?this._bitswap.put(e):this._repo.blocks.put(e)}},{key:"putMany",value:function(e){return this.hasExchange()?this._bitswap.putMany(e):this._repo.blocks.putMany(e)}},{key:"get",value:function(e){return this.hasExchange()?this._bitswap.get(e):this._repo.blocks.get(e)}},{key:"getMany",value:function(e){var t=this;if(!Array.isArray(e))throw new Error("first arg must be an array of cids");return this.hasExchange()?this._bitswap.getMany(e):a(function(e){return t._repo.blocks.get(e)})(e)}},{key:"delete",value:function(e){return this._repo.blocks.delete(e)}}])&&n(t.prototype,r),u&&n(t,u),e}();e.exports=u},function(e,t,r){"use strict";(function(e){Object.defineProperty(t,"__esModule",{value:!0}),t.batch=function e(t,r){if(void 0===r)return function(r){return e(t,r)};if(r[Symbol.asyncIterator])return function(e,t){return x(this,arguments,a.default.mark(function r(){var n,u,o,c,i,s;return a.default.wrap(function(r){for(;;)switch(r.prev=r.next){case 0:o=[],r.prev=1,c=b(t);case 3:return r.next=5,v(c.next());case 5:if((i=r.sent).done){r.next=17;break}if(s=i.value,o.push(s),o.length!==e){r.next=15;break}return r.next=12,v(o);case 12:return r.next=14,r.sent;case 14:o=[];case 15:r.next=3;break;case 17:r.next=22;break;case 19:r.prev=19,r.t0=r.catch(1),n={error:r.t0};case 22:if(r.prev=22,r.prev=23,!i||i.done||!(u=c.return)){r.next=27;break}return r.next=27,v(u.call(c));case 27:if(r.prev=27,!n){r.next=30;break}throw n.error;case 30:return r.finish(27);case 31:return r.finish(22);case 32:if(!(o.length>0)){r.next=37;break}return r.next=35,v(o);case 35:return r.next=37,r.sent;case 37:case"end":return r.stop()}},r,null,[[1,19,22,32],[23,,27,31]])}))}(t,r);return y(t,r)},t.buffer=g,t.collect=function(e){if(e[Symbol.asyncIterator])return function(e){return S.apply(this,arguments)}(e);return Array.from(e)},t.concat=function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return t.find(function(e){return void 0!==e[Symbol.asyncIterator]})?function(e){return x(this,arguments,a.default.mark(function t(){var r,n,u,o,c;return a.default.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:t.prev=0,u=b(e);case 2:return t.next=4,v(u.next());case 4:if((o=t.sent).done){t.next=14;break}return c=o.value,t.t0=v,t.delegateYield(d(b(c)),"t1",9);case 9:return t.t2=t.t1,t.next=12,(0,t.t0)(t.t2);case 12:t.next=2;break;case 14:t.next=19;break;case 16:t.prev=16,t.t3=t.catch(0),r={error:t.t3};case 19:if(t.prev=19,t.prev=20,!o||o.done||!(n=u.return)){t.next=24;break}return t.next=24,v(n.call(u));case 24:if(t.prev=24,!r){t.next=27;break}throw r.error;case 27:return t.finish(24);case 28:return t.finish(19);case 29:case"end":return t.stop()}},t,null,[[0,16,19,29],[20,,24,28]])}))}(t):_(t)},t.consume=function(e){if(e[Symbol.asyncIterator])return function(e){return E.apply(this,arguments)}(e)},t.filter=I,t.flatMap=function e(t,r){if(void 0===r)return function(r){return e(t,r)};return I(function(e){return null!=e},P(j(t,r)))},t.flatten=P,t.flatTransform=function e(t,r,n){if(void 0===r)return function(r,n){return n?e(t,r,n):e(t,r)};if(void 0===n)return function(n){return e(t,r,n)};return I(function(e){return null!=e},P(function(e,t,r){var n=k(r),o=[],i=[],s=!1,f=!1,l=0,p=null;function h(){for(;i.length>0&&o.length>0;){var e=i.shift(),t=e.resolve,r=o.shift();t({done:!1,value:r})}for(;i.length>0&&0===l&&s;){var n=i.shift(),t=n.resolve,a=n.reject;p?(a(p),p=null):t({done:!0,value:void 0})}}function v(){return x.apply(this,arguments)}function x(){return(x=c(a.default.mark(function t(){var r,u,c;return a.default.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:if(!s){t.next=3;break}return h(),t.abrupt("return");case 3:if(!f){t.next=5;break}return t.abrupt("return");case 5:if(!(l+o.length>=e)){t.next=7;break}return t.abrupt("return");case 7:return f=!0,l++,t.prev=9,t.next=12,n.next();case 12:r=t.sent,u=r.done,c=r.value,u?(s=!0,l--,h()):d(c),t.next=24;break;case 18:t.prev=18,t.t0=t.catch(9),s=!0,l--,p=t.t0,h();case 24:f=!1,v();case 26:case"end":return t.stop()}},t,null,[[9,18]])}))).apply(this,arguments)}function d(e){return y.apply(this,arguments)}function y(){return(y=c(a.default.mark(function e(r){var n,u,c,i,f,x;return a.default.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,t(r);case 3:if(!(c=e.sent)||!c[Symbol.asyncIterator]){e.next=32;break}e.prev=5,i=b(c);case 7:return e.next=9,i.next();case 9:if((f=e.sent).done){e.next=15;break}x=f.value,o.push(x);case 13:e.next=7;break;case 15:e.next=20;break;case 17:e.prev=17,e.t0=e.catch(5),n={error:e.t0};case 20:if(e.prev=20,e.prev=21,!f||f.done||!(u=i.return)){e.next=25;break}return e.next=25,u.call(i);case 25:if(e.prev=25,!n){e.next=28;break}throw n.error;case 28:return e.finish(25);case 29:return e.finish(20);case 30:e.next=33;break;case 32:o.push(c);case 33:e.next=39;break;case 35:e.prev=35,e.t1=e.catch(0),s=!0,p=e.t1;case 39:l--,h(),v();case 42:case"end":return e.stop()}},e,null,[[0,35],[5,17,20,30],[21,,25,29]])}))).apply(this,arguments)}function w(){return(w=c(a.default.mark(function e(){var t,r;return a.default.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(0!==o.length){e.next=5;break}return t=m(),i.push(t),v(),e.abrupt("return",t.promise);case 5:return r=o.shift(),v(),e.abrupt("return",{done:!1,value:r});case 8:case"end":return e.stop()}},e)}))).apply(this,arguments)}var g=u({next:function(){return w.apply(this,arguments)}},Symbol.asyncIterator,function(){return g});return g}(t,r,n)))},t.fromStream=function(e){if("function"==typeof e[Symbol.asyncIterator])return e;return function(e){return x(this,arguments,a.default.mark(function t(){var r;return a.default.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:if(null===(r=e.read())){t.next=8;break}return t.next=5,v(r);case 5:return t.next=7,t.sent;case 7:return t.abrupt("continue",0);case 8:if(!e._readableState.ended){t.next=12;break}return t.next=11,v(void 0);case 11:return t.abrupt("return",t.sent);case 12:return t.next=14,v(O(e));case 14:t.next=0;break;case 16:case"end":return t.stop()}},t)}))}(e)},t.getIterator=k,t.map=j,t.merge=function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return x(this,arguments,a.default.mark(function e(){var r,n,u,o,c,i,s,f;return a.default.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:r=new Set(t.map(k));case 1:if(!(r.size>0)){e.next=39;break}n=!0,u=!1,o=void 0,e.prev=5,c=r[Symbol.iterator]();case 7:if(n=(i=c.next()).done){e.next=23;break}return s=i.value,e.next=11,v(s.next());case 11:if(!(f=e.sent).done){e.next=16;break}r.delete(s),e.next=20;break;case 16:return e.next=18,v(f.value);case 18:return e.next=20,e.sent;case 20:n=!0,e.next=7;break;case 23:e.next=29;break;case 25:e.prev=25,e.t0=e.catch(5),u=!0,o=e.t0;case 29:e.prev=29,e.prev=30,n||null==c.return||c.return();case 32:if(e.prev=32,!u){e.next=35;break}throw o;case 35:return e.finish(32);case 36:return e.finish(29);case 37:e.next=1;break;case 39:case"end":return e.stop()}},e,null,[[5,25,29,37],[30,,32,36]])}))},t.parallelFlatMap=function e(t,r,n){if(void 0===r)return function(r,n){return n?e(t,r,n):e(t,r)};if(void 0===n)return function(n){return e(t,r,n)};return I(function(e){return null!=e},P(G(t,r,n)))},t.parallelMap=G,t.parallelMerge=function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return x(this,arguments,a.default.mark(function e(){var r,n,u,o,i,s,f,l,p,h,x,d,b,y,m,w,g;return a.default.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:for(r=t.map(k),n=new Set,u=new Map,o=function(e){var t,r=Promise.resolve(e.next()).then((t=c(a.default.mark(function t(o){var c,i;return a.default.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:c=o.done,i=o.value,c||u.set(e,i),n.delete(r);case 3:case"end":return t.stop()}},t)})),function(e){return t.apply(this,arguments)}));n.add(r)},i=!0,s=!1,f=void 0,e.prev=7,l=r[Symbol.iterator]();!(i=(p=l.next()).done);i=!0)h=p.value,o(h);e.next=15;break;case 11:e.prev=11,e.t0=e.catch(7),s=!0,f=e.t0;case 15:e.prev=15,e.prev=16,i||null==l.return||l.return();case 18:if(e.prev=18,!s){e.next=21;break}throw f;case 21:return e.finish(18);case 22:return e.finish(15);case 23:if(0!==n.size){e.next=28;break}return e.next=27,v(void 0);case 27:return e.abrupt("return",e.sent);case 28:return e.next=30,v(Promise.race(n));case 30:x=!0,d=!1,b=void 0,e.prev=33,y=u[Symbol.iterator]();case 35:if(x=(m=y.next()).done){e.next=46;break}return S=m.value,_=2,w=function(e){if(Array.isArray(e))return e}(S)||function(e,t){var r=[],n=!0,a=!1,u=void 0;try{for(var o,c=e[Symbol.iterator]();!(n=(o=c.next()).done)&&(r.push(o.value),!t||r.length!==t);n=!0);}catch(i){a=!0,u=i}finally{try{n||null==c.return||c.return()}finally{if(a)throw u}}return r}(S,_)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}(),h=w[0],g=w[1],u.delete(h),e.next=40,v(g);case 40:return e.next=42,e.sent;case 42:o(h);case 43:x=!0,e.next=35;break;case 46:e.next=52;break;case 48:e.prev=48,e.t1=e.catch(33),d=!0,b=e.t1;case 52:e.prev=52,e.prev=53,x||null==y.return||y.return();case 55:if(e.prev=55,!d){e.next=58;break}throw b;case 58:return e.finish(55);case 59:return e.finish(52);case 60:e.next=23;break;case 62:case"end":return e.stop()}var S,_},e,null,[[7,11,15,23],[16,,18,22],[33,48,52,60],[53,,55,59]])}))},t.pipeline=A,t.reduce=function e(t,r,n){if(void 0===r)return function(r,n){return n?e(t,r,n):e(t,r)};if(void 0===n)return function(n){return e(t,r,n)};return function(e,t,r){return N.apply(this,arguments)}(t,r,n)},t.take=function e(t,r){if(void 0===r)return function(r){return e(t,r)};if(r[Symbol.asyncIterator])return function(e,t){return x(this,arguments,a.default.mark(function r(){var n,u,o,c,i,s;return a.default.wrap(function(r){for(;;)switch(r.prev=r.next){case 0:o=0,r.prev=1,c=b(t);case 3:return r.next=5,v(c.next());case 5:if((i=r.sent).done){r.next=23;break}return s=i.value,r.t0=v,r.next=11,v(s);case 11:return r.t1=r.sent,r.next=14,(0,r.t0)(r.t1);case 14:return r.next=16,r.sent;case 16:if(!(++o>=e)){r.next=21;break}return r.next=20,v(void 0);case 20:return r.abrupt("return",r.sent);case 21:r.next=3;break;case 23:r.next=28;break;case 25:r.prev=25,r.t2=r.catch(1),n={error:r.t2};case 28:if(r.prev=28,r.prev=29,!i||i.done||!(u=c.return)){r.next=33;break}return r.next=33,v(u.call(c));case 33:if(r.prev=33,!n){r.next=36;break}throw n.error;case 36:return r.finish(33);case 37:return r.finish(28);case 38:case"end":return r.stop()}},r,null,[[1,25,28,38],[29,,33,37]])}))}(t,r);return F(t,r)},t.tap=function(e,t){if(void 0===t)return function(t){return Y(e,t)};return Y(e,t)},t.time=function t(){var r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};var n=arguments.length>1?arguments[1]:void 0;if(void 0===n)return function(e){return t(r,e)};return void 0!==n[Symbol.asyncIterator]?function(t,r){return x(this,arguments,a.default.mark(function n(){var u,o,c,i,s,f,l;return a.default.wrap(function(n){for(;;)switch(n.prev=n.next){case 0:u=r[Symbol.asyncIterator](),o=[0,0];case 2:return c=e.hrtime(),n.next=6,v(u.next());case 6:if(i=n.sent,s=i.value,f=i.done,l=e.hrtime(c),o=z(o,l),t.progress&&t.progress(l,o),!f){n.next=17;break}return t.total&&t.total(o),n.next=16,v(s);case 16:return n.abrupt("return",n.sent);case 17:return n.next=19,v(s);case 19:return n.next=21,n.sent;case 21:n.next=2;break;case 23:case"end":return n.stop()}},n)}))}(r,n):B(r,n)},t.transform=function e(t,r,n){if(void 0===r)return function(r,n){return n?e(t,r,n):e(t,r)};if(void 0===n)return function(n){return e(t,r,n)};return function(e,t,r){var n=k(r),o=[],i=[],s=!1,f=!1,l=0,p=null;function h(){for(;i.length>0&&o.length>0;){var e=i.shift(),t=e.resolve,r=o.shift();t({done:!1,value:r})}for(;i.length>0&&0===l&&s;){var n=i.shift(),t=n.resolve,a=n.reject;p?(a(p),p=null):t({done:!0,value:void 0})}}function v(){return x.apply(this,arguments)}function x(){return(x=c(a.default.mark(function t(){var r,u,c;return a.default.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:if(!s){t.next=3;break}return h(),t.abrupt("return");case 3:if(!f){t.next=5;break}return t.abrupt("return");case 5:if(!(l+o.length>=e)){t.next=7;break}return t.abrupt("return");case 7:return f=!0,l++,t.prev=9,t.next=12,n.next();case 12:r=t.sent,u=r.done,c=r.value,u?(s=!0,l--,h()):d(c),t.next=24;break;case 18:t.prev=18,t.t0=t.catch(9),s=!0,l--,p=t.t0,h();case 24:f=!1,v();case 26:case"end":return t.stop()}},t,null,[[9,18]])}))).apply(this,arguments)}function d(e){return b.apply(this,arguments)}function b(){return(b=c(a.default.mark(function e(r){var n;return a.default.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,t(r);case 3:n=e.sent,o.push(n),e.next=11;break;case 7:e.prev=7,e.t0=e.catch(0),s=!0,p=e.t0;case 11:l--,h(),v();case 14:case"end":return e.stop()}},e,null,[[0,7]])}))).apply(this,arguments)}function y(){return(y=c(a.default.mark(function e(){var t,r;return a.default.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(0!==o.length){e.next=5;break}return t=m(),i.push(t),v(),e.abrupt("return",t.promise);case 5:return r=o.shift(),v(),e.abrupt("return",{done:!1,value:r});case 8:case"end":return e.stop()}},e)}))).apply(this,arguments)}var w=u({next:function(){return y.apply(this,arguments)}},Symbol.asyncIterator,function(){return w});return w}(t,r,n)},t.writeToStream=function(e,t){if(void 0===t)return function(t){return C(e,t)};return C(e,t)};var n,a=(n=r(4))&&n.__esModule?n:{default:n};function u(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function o(e,t,r,n,a,u,o){try{var c=e[u](o),i=c.value}catch(s){return void r(s)}c.done?t(i):Promise.resolve(i).then(n,a)}function c(e){return function(){var t=this,r=arguments;return new Promise(function(n,a){var u=e.apply(t,r);function c(e){o(u,n,a,c,i,"next",e)}function i(e){o(u,n,a,c,i,"throw",e)}c(void 0)})}}var i=a.default.mark(y),s=a.default.mark(w),f=a.default.mark(_),l=a.default.mark(F),p=a.default.mark(B);function h(e){var t="function"==typeof Symbol&&e[Symbol.iterator],r=0;return t?t.call(e):{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}}}function v(e){return this instanceof v?(this.v=e,this):new v(e)}function x(e,t,r){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var n,a=r.apply(e,t||[]),u=[];return n={},o("next"),o("throw"),o("return"),n[Symbol.asyncIterator]=function(){return this},n;function o(e){a[e]&&(n[e]=function(t){return new Promise(function(r,n){u.push([e,t,r,n])>1||c(e,t)})})}function c(e,t){try{(r=a[e](t)).value instanceof v?Promise.resolve(r.value.v).then(i,s):f(u[0][2],r)}catch(n){f(u[0][3],n)}var r}function i(e){c("next",e)}function s(e){c("throw",e)}function f(e,t){e(t),u.shift(),u.length&&c(u[0][0],u[0][1])}}function d(e){var t,r;return t={},n("next"),n("throw",function(e){throw e}),n("return"),t[Symbol.iterator]=function(){return this},t;function n(n,a){t[n]=e[n]?function(t){return(r=!r)?{value:v(e[n](t)),done:"return"===n}:a?a(t):t}:a}}function b(e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var t,r=e[Symbol.asyncIterator];return r?r.call(e):(e=h(e),t={},n("next"),n("throw"),n("return"),t[Symbol.asyncIterator]=function(){return this},t);function n(r){t[r]=e[r]&&function(t){return new Promise(function(n,a){(function(e,t,r,n){Promise.resolve(n).then(function(t){e({value:t,done:r})},t)})(n,a,(t=e[r](t)).done,t.value)})}}}function y(e,t){var r,n,u,o,c,s,f;return a.default.wrap(function(a){for(;;)switch(a.prev=a.next){case 0:r=[],n=!0,u=!1,o=void 0,a.prev=4,c=t[Symbol.iterator]();case 6:if(n=(s=c.next()).done){a.next=16;break}if(f=s.value,r.push(f),r.length!==e){a.next=13;break}return a.next=12,r;case 12:r=[];case 13:n=!0,a.next=6;break;case 16:a.next=22;break;case 18:a.prev=18,a.t0=a.catch(4),u=!0,o=a.t0;case 22:a.prev=22,a.prev=23,n||null==c.return||c.return();case 25:if(a.prev=25,!u){a.next=28;break}throw o;case 28:return a.finish(25);case 29:return a.finish(22);case 30:if(!(r.length>0)){a.next=33;break}return a.next=33,r;case 33:case"end":return a.stop()}},i,null,[[4,18,22,30],[23,,25,29]])}function k(e){if("function"==typeof e.next)return e;if("function"==typeof e[Symbol.iterator])return e[Symbol.iterator]();if("function"==typeof e[Symbol.asyncIterator])return e[Symbol.asyncIterator]();throw new TypeError('"values" does not to conform to any of the iterator or iterable protocols')}function m(){var e,t;return{promise:new Promise(function(r,n){t=r,e=n}),reject:e,resolve:t}}function w(e,t){var r,n,u,o,c,i,f,l,p,h,v;return a.default.wrap(function(a){for(;;)switch(a.prev=a.next){case 0:r=[],a.prev=1,u=!0,o=!1,c=void 0,a.prev=5,i=t[Symbol.iterator]();case 7:if(u=(f=i.next()).done){a.next=17;break}if(l=f.value,r.push(l),!(r.length<=e)){a.next=12;break}return a.abrupt("continue",14);case 12:return a.next=14,r.shift();case 14:u=!0,a.next=7;break;case 17:a.next=23;break;case 19:a.prev=19,a.t0=a.catch(5),o=!0,c=a.t0;case 23:a.prev=23,a.prev=24,u||null==i.return||i.return();case 26:if(a.prev=26,!o){a.next=29;break}throw c;case 29:return a.finish(26);case 30:return a.finish(23);case 31:a.next=36;break;case 33:a.prev=33,a.t1=a.catch(1),n=a.t1;case 36:p=0,h=r;case 37:if(!(p<h.length)){a.next=44;break}return v=h[p],a.next=41,v;case 41:p++,a.next=37;break;case 44:if(!n){a.next=46;break}throw n;case 46:case"end":return a.stop()}},s,null,[[1,33],[5,19,23,31],[24,,26,30]])}function g(e,t){return void 0===t?function(t){return g(e,t)}:t[Symbol.asyncIterator]?function(e,t){var r=k(t),n=[],o=[],i=!1,s=!1;function f(){for(;o.length>0&&n.length>0;){var e=o.shift(),t=n.shift(),r=t.error,a=t.value;r?e.reject(r):e.resolve({done:!1,value:a})}for(;o.length>0&&s;)(0,o.shift().resolve)({done:!0,value:void 0})}function l(){return p.apply(this,arguments)}function p(){return(p=c(a.default.mark(function t(){var u,o,c;return a.default.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:if(!s){t.next=2;break}return t.abrupt("return");case 2:if(!i){t.next=4;break}return t.abrupt("return");case 4:if(!(n.length>=e)){t.next=6;break}return t.abrupt("return");case 6:return i=!0,t.prev=7,t.next=10,r.next();case 10:u=t.sent,o=u.done,c=u.value,o?s=!0:n.push({value:c}),t.next=20;break;case 16:t.prev=16,t.t0=t.catch(7),s=!0,n.push({error:t.t0});case 20:f(),i=!1,l();case 23:case"end":return t.stop()}},t,null,[[7,16]])}))).apply(this,arguments)}function h(){return(h=c(a.default.mark(function e(){var t,r,u,c;return a.default.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(!(n.length>0)){e.next=6;break}if(t=n.shift(),r=t.error,u=t.value,!r){e.next=4;break}throw r;case 4:return l(),e.abrupt("return",{done:!1,value:u});case 6:if(!s){e.next=8;break}return e.abrupt("return",{done:!0,value:void 0});case 8:return c=m(),o.push(c),l(),e.abrupt("return",c.promise);case 12:case"end":return e.stop()}},e)}))).apply(this,arguments)}var v=u({next:function(){return h.apply(this,arguments)}},Symbol.asyncIterator,function(){return v});return v}(e,t):w(e,t)}function S(){return(S=c(a.default.mark(function e(t){var r,n,u,o,c,i;return a.default.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:u=[],e.prev=1,o=b(t);case 3:return e.next=5,o.next();case 5:if((c=e.sent).done){e.next=11;break}i=c.value,u.push(i);case 9:e.next=3;break;case 11:e.next=16;break;case 13:e.prev=13,e.t0=e.catch(1),r={error:e.t0};case 16:if(e.prev=16,e.prev=17,!c||c.done||!(n=o.return)){e.next=21;break}return e.next=21,n.call(o);case 21:if(e.prev=21,!r){e.next=24;break}throw r.error;case 24:return e.finish(21);case 25:return e.finish(16);case 26:return e.abrupt("return",u);case 27:case"end":return e.stop()}},e,null,[[1,13,16,26],[17,,21,25]])}))).apply(this,arguments)}function _(e){var t,r,n,u,o,c;return a.default.wrap(function(a){for(;;)switch(a.prev=a.next){case 0:t=!0,r=!1,n=void 0,a.prev=3,u=e[Symbol.iterator]();case 5:if(t=(o=u.next()).done){a.next=11;break}return c=o.value,a.delegateYield(c,"t0",8);case 8:t=!0,a.next=5;break;case 11:a.next=17;break;case 13:a.prev=13,a.t1=a.catch(3),r=!0,n=a.t1;case 17:a.prev=17,a.prev=18,t||null==u.return||u.return();case 20:if(a.prev=20,!r){a.next=23;break}throw n;case 23:return a.finish(20);case 24:return a.finish(17);case 25:case"end":return a.stop()}},f,null,[[3,13,17,25],[18,,20,24]])}function E(){return(E=c(a.default.mark(function e(t){var r,n,u,o;return a.default.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:e.prev=0,u=b(t);case 2:return e.next=4,u.next();case 4:if((o=e.sent).done){e.next=9;break}o.value;case 7:e.next=2;break;case 9:e.next=14;break;case 11:e.prev=11,e.t0=e.catch(0),r={error:e.t0};case 14:if(e.prev=14,e.prev=15,!o||o.done||!(n=u.return)){e.next=19;break}return e.next=19,n.call(u);case 19:if(e.prev=19,!r){e.next=22;break}throw r.error;case 22:return e.finish(19);case 23:return e.finish(14);case 24:case"end":return e.stop()}},e,null,[[0,11,14,24],[15,,19,23]])}))).apply(this,arguments)}function L(e,t){return x(this,arguments,a.default.mark(function r(){var n,u,o,c,i;return a.default.wrap(function(r){for(;;)switch(r.prev=r.next){case 0:r.prev=0,o=b(t);case 2:return r.next=4,v(o.next());case 4:if((c=r.sent).done){r.next=16;break}return i=c.value,r.next=9,v(e(i));case 9:if(!r.sent){r.next=14;break}return r.next=12,v(i);case 12:return r.next=14,r.sent;case 14:r.next=2;break;case 16:r.next=21;break;case 18:r.prev=18,r.t0=r.catch(0),n={error:r.t0};case 21:if(r.prev=21,r.prev=22,!c||c.done||!(u=o.return)){r.next=26;break}return r.next=26,v(u.call(o));case 26:if(r.prev=26,!n){r.next=29;break}throw n.error;case 29:return r.finish(26);case 30:return r.finish(21);case 31:case"end":return r.stop()}},r,null,[[0,18,21,31],[22,,26,30]])}))}function I(e,t){return void 0===t?function(t){return L(e,t)}:L(e,t)}function P(e){return x(this,arguments,a.default.mark(function t(){var r,n,u,o,c;return a.default.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:t.prev=0,u=b(e);case 2:return t.next=4,v(u.next());case 4:if((o=t.sent).done){t.next=21;break}if(!(c=o.value)||"string"==typeof c||!c[Symbol.iterator]&&!c[Symbol.asyncIterator]){t.next=15;break}return t.t0=v,t.delegateYield(d(b(P(c))),"t1",10);case 10:return t.t2=t.t1,t.next=13,(0,t.t0)(t.t2);case 13:t.next=19;break;case 15:return t.next=17,v(c);case 17:return t.next=19,t.sent;case 19:t.next=2;break;case 21:t.next=26;break;case 23:t.prev=23,t.t3=t.catch(0),r={error:t.t3};case 26:if(t.prev=26,t.prev=27,!o||o.done||!(n=u.return)){t.next=31;break}return t.next=31,v(n.call(u));case 31:if(t.prev=31,!r){t.next=34;break}throw r.error;case 34:return t.finish(31);case 35:return t.finish(26);case 36:case"end":return t.stop()}},t,null,[[0,23,26,36],[27,,31,35]])}))}function T(e,t){return x(this,arguments,a.default.mark(function r(){var n,u,o,c,i;return a.default.wrap(function(r){for(;;)switch(r.prev=r.next){case 0:r.prev=0,o=b(t);case 2:return r.next=4,v(o.next());case 4:if((c=r.sent).done){r.next=17;break}return i=c.value,r.t0=v,r.next=10,v(e(i));case 10:return r.t1=r.sent,r.next=13,(0,r.t0)(r.t1);case 13:return r.next=15,r.sent;case 15:r.next=2;break;case 17:r.next=22;break;case 19:r.prev=19,r.t2=r.catch(0),n={error:r.t2};case 22:if(r.prev=22,r.prev=23,!c||c.done||!(u=o.return)){r.next=27;break}return r.next=27,v(u.call(o));case 27:if(r.prev=27,!n){r.next=30;break}throw n.error;case 30:return r.finish(27);case 31:return r.finish(22);case 32:case"end":return r.stop()}},r,null,[[0,19,22,32],[23,,27,31]])}))}function j(e,t){return void 0===t?function(t){return T(e,t)}:T(e,t)}function O(e){return M.apply(this,arguments)}function M(){return(M=c(a.default.mark(function e(t){return a.default.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise(function(e){t.once("readable",function(){e()})}));case 1:case"end":return e.stop()}},e)}))).apply(this,arguments)}function A(e){for(var t=e(),r=arguments.length,n=new Array(r>1?r-1:0),a=1;a<r;a++)n[a-1]=arguments[a];for(var u=0,o=n;u<o.length;u++){t=(0,o[u])(t)}return t}function G(e,t,r){return void 0===t?function(t,r){return G(e,t,r)}:void 0===r?function(r){return G(e,t,r)}:function(e,t,r){return x(this,arguments,a.default.mark(function n(){var u,o,c,i,s,f,l,p;return a.default.wrap(function(n){for(;;)switch(n.prev=n.next){case 0:u=null,o=function(e){return{value:t(e)}},c=function(e){return x(this,arguments,a.default.mark(function t(){var r,n,o,c,i;return a.default.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:t.prev=0,o=b(e);case 2:return t.next=4,v(o.next());case 4:if((c=t.sent).done){t.next=17;break}if(i=c.value,!u){t.next=11;break}return t.next=10,v(void 0);case 10:return t.abrupt("return",t.sent);case 11:return t.next=13,v(i);case 13:return t.next=15,t.sent;case 15:t.next=2;break;case 17:t.next=22;break;case 19:t.prev=19,t.t0=t.catch(0),r={error:t.t0};case 22:if(t.prev=22,t.prev=23,!c||c.done||!(n=o.return)){t.next=27;break}return t.next=27,v(n.call(o));case 27:if(t.prev=27,!r){t.next=30;break}throw r.error;case 30:return t.finish(27);case 31:return t.finish(22);case 32:case"end":return t.stop()}},t,null,[[0,19,22,32],[23,,27,31]])}))},i=A(function(){return r},g(1),c,j(o),g(e)),s=k(i);case 5:return n.next=8,v(s.next());case 8:if(f=n.sent,l=f.value,!f.done){n.next=13;break}return n.abrupt("break",29);case 13:return n.prev=13,n.next=16,v(l.value);case 16:if(p=n.sent,u){n.next=22;break}return n.next=20,v(p);case 20:return n.next=22,n.sent;case 22:n.next=27;break;case 24:n.prev=24,n.t0=n.catch(13),u=n.t0;case 27:n.next=5;break;case 29:if(!u){n.next=31;break}throw u;case 31:case"end":return n.stop()}},n,null,[[13,24]])}))}(e,t,r)}function N(){return(N=c(a.default.mark(function e(t,r,n){var u,o,c,i,s,f;return a.default.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:c=r,e.prev=1,i=b(n);case 3:return e.next=5,i.next();case 5:if((s=e.sent).done){e.next=13;break}return f=s.value,e.next=10,t(c,f);case 10:c=e.sent;case 11:e.next=3;break;case 13:e.next=18;break;case 15:e.prev=15,e.t0=e.catch(1),u={error:e.t0};case 18:if(e.prev=18,e.prev=19,!s||s.done||!(o=i.return)){e.next=23;break}return e.next=23,o.call(i);case 23:if(e.prev=23,!u){e.next=26;break}throw u.error;case 26:return e.finish(23);case 27:return e.finish(18);case 28:return e.abrupt("return",c);case 29:case"end":return e.stop()}},e,null,[[1,15,18,28],[19,,23,27]])}))).apply(this,arguments)}function F(e,t){var r,n,u,o,c,i,s;return a.default.wrap(function(a){for(;;)switch(a.prev=a.next){case 0:r=0,n=!0,u=!1,o=void 0,a.prev=4,c=t[Symbol.iterator]();case 6:if(n=(i=c.next()).done){a.next=16;break}return s=i.value,a.next=10,s;case 10:if(!(++r>=e)){a.next=13;break}return a.abrupt("return");case 13:n=!0,a.next=6;break;case 16:a.next=22;break;case 18:a.prev=18,a.t0=a.catch(4),u=!0,o=a.t0;case 22:a.prev=22,a.prev=23,n||null==c.return||c.return();case 25:if(a.prev=25,!u){a.next=28;break}throw o;case 28:return a.finish(25);case 29:return a.finish(22);case 30:case"end":return a.stop()}},l,null,[[4,18,22,30],[23,,25,29]])}function Y(e,t){return x(this,arguments,a.default.mark(function r(){var n,u,o,c,i;return a.default.wrap(function(r){for(;;)switch(r.prev=r.next){case 0:r.prev=0,o=b(t);case 2:return r.next=4,v(o.next());case 4:if((c=r.sent).done){r.next=15;break}return i=c.value,r.next=9,v(e(i));case 9:return r.next=11,v(i);case 11:return r.next=13,r.sent;case 13:r.next=2;break;case 15:r.next=20;break;case 17:r.prev=17,r.t0=r.catch(0),n={error:r.t0};case 20:if(r.prev=20,r.prev=21,!c||c.done||!(u=o.return)){r.next=25;break}return r.next=25,v(u.call(o));case 25:if(r.prev=25,!n){r.next=28;break}throw n.error;case 28:return r.finish(25);case 29:return r.finish(20);case 30:case"end":return r.stop()}},r,null,[[0,17,20,30],[21,,25,29]])}))}function z(e,t){var r=e[0]+t[0],n=e[1]+t[1];if(n>=1e9){var a=n%1e9;r+=(n-a)/1e9,n=a}return[r,n]}function B(t,r){var n,u,o,c,i,s,f;return a.default.wrap(function(a){for(;;)switch(a.prev=a.next){case 0:n=r[Symbol.iterator](),u=[0,0];case 2:if(o=e.hrtime(),c=n.next(),i=c.value,s=c.done,f=e.hrtime(o),u=z(u,f),t.progress&&t.progress(f,u),!s){a.next=11;break}return t.total&&t.total(u),a.abrupt("return",i);case 11:return a.next=13,i;case 13:a.next=2;break;case 15:case"end":return a.stop()}},p)}function R(e,t){return new Promise(function(r){t.once(e,r)})}function C(e,t){return q.apply(this,arguments)}function q(){return(q=c(a.default.mark(function e(t,r){var n,u,o,c,i,s,f,l;return a.default.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:i=new Promise(function(e,r){o=function(e){c=e,r(e)},t.once("error",o)}),e.prev=1,s=b(r);case 3:return e.next=5,s.next();case 5:if((f=e.sent).done){e.next=15;break}if(l=f.value,!1!==t.write(l)){e.next=11;break}return e.next=11,Promise.race([i,R("drain",t)]);case 11:if(!c){e.next=13;break}return e.abrupt("return",i);case 13:e.next=3;break;case 15:e.next=20;break;case 17:e.prev=17,e.t0=e.catch(1),n={error:e.t0};case 20:if(e.prev=20,e.prev=21,!f||f.done||!(u=s.return)){e.next=25;break}return e.next=25,u.call(s);case 25:if(e.prev=25,!n){e.next=28;break}throw n.error;case 28:return e.finish(25);case 29:return e.finish(20);case 30:if(t.removeListener("error",o),!c){e.next=33;break}return e.abrupt("return",i);case 33:case"end":return e.stop()}},e,null,[[1,17,20,30],[21,,25,29]])}))).apply(this,arguments)}void 0===Symbol.asyncIterator&&(Symbol.asyncIterator=Symbol.for("asyncIterator"))}).call(this,r(3))},function(e,t,r){"use strict";var n,a,u=e.exports={};function o(){throw new Error("setTimeout has not been defined")}function c(){throw new Error("clearTimeout has not been defined")}function i(e){if(n===setTimeout)return setTimeout(e,0);if((n===o||!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:o}catch(e){n=o}try{a="function"==typeof clearTimeout?clearTimeout:c}catch(e){a=c}}();var s,f=[],l=!1,p=-1;function h(){l&&s&&(l=!1,s.length?f=s.concat(f):p=-1,f.length&&v())}function v(){if(!l){var e=i(h);l=!0;for(var t=f.length;t;){for(s=f,f=[];++p<t;)s&&s[p].run();p=-1,t=f.length}s=null,l=!1,function(e){if(a===clearTimeout)return clearTimeout(e);if((a===c||!a)&&clearTimeout)return a=clearTimeout,clearTimeout(e);try{a(e)}catch(t){try{return a.call(null,e)}catch(t){return a.call(this,e)}}}(e)}}function x(e,t){this.fun=e,this.array=t}function d(){}u.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 x(e,t)),1!==f.length||l||i(v)},x.prototype.run=function(){this.fun.apply(null,this.array)},u.title="browser",u.browser=!0,u.env={},u.argv=[],u.version="",u.versions={},u.on=d,u.addListener=d,u.once=d,u.off=d,u.removeListener=d,u.removeAllListeners=d,u.emit=d,u.prependListener=d,u.prependOnceListener=d,u.listeners=function(e){return[]},u.binding=function(e){throw new Error("process.binding is not supported")},u.cwd=function(){return"/"},u.chdir=function(e){throw new Error("process.chdir is not supported")},u.umask=function(){return 0}},function(e,t,r){e.exports=r(5)},function(e,t,r){"use strict";(function(e){function t(e){return(t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}var r=function(e){var r,n=Object.prototype,a=n.hasOwnProperty,u="function"==typeof Symbol?Symbol:{},o=u.iterator||"@@iterator",c=u.asyncIterator||"@@asyncIterator",i=u.toStringTag||"@@toStringTag";function s(e,t,r,n){var a=t&&t.prototype instanceof d?t:d,u=Object.create(a.prototype),o=new P(n||[]);return u._invoke=function(e,t,r){var n=l;return function(a,u){if(n===h)throw new Error("Generator is already running");if(n===v){if("throw"===a)throw u;return j()}for(r.method=a,r.arg=u;;){var o=r.delegate;if(o){var c=E(o,r);if(c){if(c===x)continue;return c}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(n===l)throw n=v,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n=h;var i=f(e,t,r);if("normal"===i.type){if(n=r.done?v:p,i.arg===x)continue;return{value:i.arg,done:r.done}}"throw"===i.type&&(n=v,r.method="throw",r.arg=i.arg)}}}(e,r,o),u}function f(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(n){return{type:"throw",arg:n}}}e.wrap=s;var l="suspendedStart",p="suspendedYield",h="executing",v="completed",x={};function d(){}function b(){}function y(){}var k={};k[o]=function(){return this};var m=Object.getPrototypeOf,w=m&&m(m(T([])));w&&w!==n&&a.call(w,o)&&(k=w);var g=y.prototype=d.prototype=Object.create(k);function S(e){["next","throw","return"].forEach(function(t){e[t]=function(e){return this._invoke(t,e)}})}function _(e){var r;this._invoke=function(n,u){function o(){return new Promise(function(r,o){!function r(n,u,o,c){var i=f(e[n],e,u);if("throw"!==i.type){var s=i.arg,l=s.value;return l&&"object"===t(l)&&a.call(l,"__await")?Promise.resolve(l.__await).then(function(e){r("next",e,o,c)},function(e){r("throw",e,o,c)}):Promise.resolve(l).then(function(e){s.value=e,o(s)},function(e){return r("throw",e,o,c)})}c(i.arg)}(n,u,r,o)})}return r=r?r.then(o,o):o()}}function E(e,t){var n=e.iterator[t.method];if(n===r){if(t.delegate=null,"throw"===t.method){if(e.iterator.return&&(t.method="return",t.arg=r,E(e,t),"throw"===t.method))return x;t.method="throw",t.arg=new TypeError("The iterator does not provide a 'throw' method")}return x}var a=f(n,e.iterator,t.arg);if("throw"===a.type)return t.method="throw",t.arg=a.arg,t.delegate=null,x;var u=a.arg;return u?u.done?(t[e.resultName]=u.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=r),t.delegate=null,x):u:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,x)}function L(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function I(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function P(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(L,this),this.reset(!0)}function T(e){if(e){var t=e[o];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var n=-1,u=function t(){for(;++n<e.length;)if(a.call(e,n))return t.value=e[n],t.done=!1,t;return t.value=r,t.done=!0,t};return u.next=u}}return{next:j}}function j(){return{value:r,done:!0}}return b.prototype=g.constructor=y,y.constructor=b,y[i]=b.displayName="GeneratorFunction",e.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===b||"GeneratorFunction"===(t.displayName||t.name))},e.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,y):(e.__proto__=y,i in e||(e[i]="GeneratorFunction")),e.prototype=Object.create(g),e},e.awrap=function(e){return{__await:e}},S(_.prototype),_.prototype[c]=function(){return this},e.AsyncIterator=_,e.async=function(t,r,n,a){var u=new _(s(t,r,n,a));return e.isGeneratorFunction(r)?u:u.next().then(function(e){return e.done?e.value:u.next()})},S(g),g[i]="Generator",g[o]=function(){return this},g.toString=function(){return"[object Generator]"},e.keys=function(e){var t=[];for(var r in e)t.push(r);return t.reverse(),function r(){for(;t.length;){var n=t.pop();if(n in e)return r.value=n,r.done=!1,r}return r.done=!0,r}},e.values=T,P.prototype={constructor:P,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=r,this.done=!1,this.delegate=null,this.method="next",this.arg=r,this.tryEntries.forEach(I),!e)for(var t in this)"t"===t.charAt(0)&&a.call(this,t)&&!isNaN(+t.slice(1))&&(this[t]=r)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var t=this;function n(n,a){return c.type="throw",c.arg=e,t.next=n,a&&(t.method="next",t.arg=r),!!a}for(var u=this.tryEntries.length-1;u>=0;--u){var o=this.tryEntries[u],c=o.completion;if("root"===o.tryLoc)return n("end");if(o.tryLoc<=this.prev){var i=a.call(o,"catchLoc"),s=a.call(o,"finallyLoc");if(i&&s){if(this.prev<o.catchLoc)return n(o.catchLoc,!0);if(this.prev<o.finallyLoc)return n(o.finallyLoc)}else if(i){if(this.prev<o.catchLoc)return n(o.catchLoc,!0)}else{if(!s)throw new Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return n(o.finallyLoc)}}}},abrupt:function(e,t){for(var r=this.tryEntries.length-1;r>=0;--r){var n=this.tryEntries[r];if(n.tryLoc<=this.prev&&a.call(n,"finallyLoc")&&this.prev<n.finallyLoc){var u=n;break}}u&&("break"===e||"continue"===e)&&u.tryLoc<=t&&t<=u.finallyLoc&&(u=null);var o=u?u.completion:{};return o.type=e,o.arg=t,u?(this.method="next",this.next=u.finallyLoc,x):this.complete(o)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),x},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),I(r),x}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var a=n.arg;I(r)}return a}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,n){return this.delegate={iterator:T(e),resultName:t,nextLoc:n},"next"===this.method&&(this.arg=r),x}},e}("object"===t(e)?e.exports:{});try{regeneratorRuntime=r}catch(n){Function("r","regeneratorRuntime = r")(r)}}).call(this,r(6)(e))},function(e,t,r){"use strict";e.exports=function(e){return e.webpackPolyfill||(e.deprecate=function(){},e.paths=[],e.children||(e.children=[]),Object.defineProperty(e,"loaded",{enumerable:!0,get:function(){return e.l}}),Object.defineProperty(e,"id",{enumerable:!0,get:function(){return e.i}}),e.webpackPolyfill=1),e}}])});
/*! For license information please see index.min.js.LICENSE.txt */
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.IpfsBlockService=e():t.IpfsBlockService=e()}(window,(function(){return function(t){var e={};function n(r){if(e[r])return e[r].exports;var o=e[r]={i:r,l:!1,exports:{}};return t[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}return n.m=t,n.c=e,n.d=function(t,e,r){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:r})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var o in t)n.d(r,o,function(e){return t[e]}.bind(null,o));return r},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s=0)}([function(t,e,n){t.exports=n(1)},function(t,e,n){"use strict";const{map:r}=n(2),o=n(4);t.exports=class{constructor(t){this._repo=t,this._bitswap=null}setExchange(t){this._bitswap=t}unsetExchange(){this._bitswap=null}hasExchange(){return null!=this._bitswap}put(t,e){return this.hasExchange()?this._bitswap.put(t,e):this._repo.blocks.put(t,e)}putMany(t,e){return this.hasExchange()?this._bitswap.putMany(t,e):this._repo.blocks.putMany(t,e)}get(t,e){return this.hasExchange()?this._bitswap.get(t,e):this._repo.blocks.get(t,e)}getMany(t,e){if(!Array.isArray(t))throw new Error("first arg must be an array of cids");if(this.hasExchange())return this._bitswap.getMany(t,e);return r(t=>this._repo.blocks.get(t,e))(t)}async delete(t,e){if(!await this._repo.blocks.has(t))throw o(new Error("blockstore: block not found"),"ERR_BLOCK_NOT_FOUND");return this._repo.blocks.delete(t,e)}}},function(t,e,n){"use strict";(function(t){function n(t){var e="function"==typeof Symbol&&t[Symbol.iterator],n=0;return e?e.call(t):{next:function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}}}function r(t){return this instanceof r?(this.v=t,this):new r(t)}function o(t,e,n){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var o,i=n.apply(t,e||[]),l=[];return o={},u("next"),u("throw"),u("return"),o[Symbol.asyncIterator]=function(){return this},o;function u(t){i[t]&&(o[t]=function(e){return new Promise((function(n,r){l.push([t,e,n,r])>1||c(t,e)}))})}function c(t,e){try{(n=i[t](e)).value instanceof r?Promise.resolve(n.value.v).then(a,f):s(l[0][2],n)}catch(o){s(l[0][3],o)}var n}function a(t){c("next",t)}function f(t){c("throw",t)}function s(t,e){t(e),l.shift(),l.length&&c(l[0][0],l[0][1])}}function i(t){var e,n;return e={},o("next"),o("throw",(function(t){throw t})),o("return"),e[Symbol.iterator]=function(){return this},e;function o(o,i){e[o]=t[o]?function(e){return(n=!n)?{value:r(t[o](e)),done:"return"===o}:i?i(e):e}:i}}function l(t){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var e,r=t[Symbol.asyncIterator];return r?r.call(t):(t=n(t),e={},o("next"),o("throw"),o("return"),e[Symbol.asyncIterator]=function(){return this},e);function o(n){e[n]=t[n]&&function(e){return new Promise((function(r,o){(function(t,e,n,r){Promise.resolve(r).then((function(e){t({value:e,done:n})}),e)})(r,o,(e=t[n](e)).done,e.value)}))}}}function u(t){if("function"==typeof t.next)return t;if("function"==typeof t[Symbol.iterator])return t[Symbol.iterator]();if("function"==typeof t[Symbol.asyncIterator])return t[Symbol.asyncIterator]();throw new TypeError('"values" does not to conform to any of the iterator or iterable protocols')}function c(){let t,e;return{promise:new Promise((n,r)=>{e=n,t=r}),reject:t,resolve:e}}function a(t,e){const n=u(e),r=[],o=[];let i=!1,l=!1;async function a(){if(!l&&!(i||r.length>=t)){i=!0;try{const{done:t,value:e}=await n.next();t?l=!0:r.push({value:e})}catch(e){l=!0,r.push({error:e})}!function(){for(;o.length>0&&r.length>0;){const t=o.shift(),{error:e,value:n}=r.shift();e?t.reject(e):t.resolve({done:!1,value:n})}for(;o.length>0&&l;){const{resolve:t}=o.shift();t({done:!0,value:void 0})}}(),i=!1,a()}}const f={next:async function(){if(r.length>0){const{error:t,value:e}=r.shift();if(t)throw t;return a(),{done:!1,value:e}}if(l)return{done:!0,value:void 0};const t=c();return o.push(t),a(),t.promise},[Symbol.asyncIterator]:()=>f};return f}function f(t,e){return void 0===e?e=>f(t,e):e[Symbol.asyncIterator]?a(t,e):function*(t,e){const n=[];let r;try{for(const r of e)n.push(r),n.length<=t||(yield n.shift())}catch(o){r=o}for(const i of n)yield i;if(r)throw r}(t,e)}function s(t,e){return o(this,arguments,(function*(){var n,o;try{for(var i,u=l(e);!(i=yield r(u.next())).done;){const e=i.value;(yield r(t(e)))&&(yield yield r(e))}}catch(c){n={error:c}}finally{try{i&&!i.done&&(o=u.return)&&(yield r(o.call(u)))}finally{if(n)throw n.error}}}))}function y(t,e){return void 0===e?e=>s(t,e):s(t,e)}function d(t){return o(this,arguments,(function*(){var e,n;try{for(var o,u=l(t);!(o=yield r(u.next())).done;){const t=o.value;t&&"string"!=typeof t&&(t[Symbol.iterator]||t[Symbol.asyncIterator])?yield r(yield*i(l(d(t)))):yield yield r(t)}}catch(c){e={error:c}}finally{try{o&&!o.done&&(n=u.return)&&(yield r(n.call(u)))}finally{if(e)throw e.error}}}))}function h(t,e){return o(this,arguments,(function*(){var n,o;try{for(var i,u=l(e);!(i=yield r(u.next())).done;){const e=i.value;yield yield r(yield r(t(e)))}}catch(c){n={error:c}}finally{try{i&&!i.done&&(o=u.return)&&(yield r(o.call(u)))}finally{if(n)throw n.error}}}))}function v(t,e){return void 0===e?e=>h(t,e):h(t,e)}async function p(t){return new Promise(e=>{t.once("readable",()=>{e()})})}function m(t,...e){let n=t();for(const r of e)n=r(n);return n}function w(t,e,n){return void 0===e?(e,n)=>w(t,e,n):void 0===n?n=>w(t,e,n):function(t,e,n){return o(this,arguments,(function*(){let i=null;const c=u(m(()=>n,f(1),(function(t){return o(this,arguments,(function*(){var e,n;try{for(var o,u=l(t);!(o=yield r(u.next())).done;){const t=o.value;if(i)return yield r(void 0);yield yield r(t)}}catch(c){e={error:c}}finally{try{o&&!o.done&&(n=u.return)&&(yield r(n.call(u)))}finally{if(e)throw e.error}}}))}),v(t=>({value:e(t)})),f(t)));for(;;){const{value:t,done:e}=yield r(c.next());if(e)break;try{const e=yield r(t.value);i||(yield yield r(e))}catch(a){i=a}}if(i)throw i}))}(t,e,n)}function b(t,e){return o(this,arguments,(function*(){var n,o;try{for(var i,u=l(e);!(i=yield r(u.next())).done;){const e=i.value;yield r(t(e)),yield yield r(e)}}catch(c){n={error:c}}finally{try{i&&!i.done&&(o=u.return)&&(yield r(o.call(u)))}finally{if(n)throw n.error}}}))}function g(t,e){let n=t[0]+e[0],r=t[1]+e[1];if(r>=1e9){const t=r%1e9;n+=(r-t)/1e9,r=t}return[n,r]}async function x(t,e){var n,r;let o=null,i=null,u=null;const c=t=>{o=t,i&&i(t)},a=()=>{u&&u()};t.once("error",c);try{for(var f,s=l(e);!(f=await s.next()).done;){const e=f.value;if(!1===t.write(e)&&await new Promise((e,n)=>{if(o)return n(o);t.once("drain",a),u=e,i=n}),o)break}}catch(y){n={error:y}}finally{try{f&&!f.done&&(r=s.return)&&await r.call(s)}finally{if(n)throw n.error}}if(t.removeListener("error",c),t.removeListener("drain",a),o)throw o}Object.defineProperty(e,"__esModule",{value:!0}),e.batch=function t(e,n){if(void 0===n)return n=>t(e,n);if(n[Symbol.asyncIterator])return function(t,e){return o(this,arguments,(function*(){var n,o;let i=[];try{for(var u,c=l(e);!(u=yield r(c.next())).done;){const e=u.value;i.push(e),i.length===t&&(yield yield r(i),i=[])}}catch(a){n={error:a}}finally{try{u&&!u.done&&(o=c.return)&&(yield r(o.call(c)))}finally{if(n)throw n.error}}i.length>0&&(yield yield r(i))}))}(e,n);return function*(t,e){let n=[];for(const r of e)n.push(r),n.length===t&&(yield n,n=[]);n.length>0&&(yield n)}(e,n)},e.buffer=f,e.collect=function(t){if(t[Symbol.asyncIterator])return async function(t){var e,n;const r=[];try{for(var o,i=l(t);!(o=await i.next()).done;){const t=o.value;r.push(t)}}catch(u){e={error:u}}finally{try{o&&!o.done&&(n=i.return)&&await n.call(i)}finally{if(e)throw e.error}}return r}(t);return Array.from(t)},e.concat=function(...t){return t.find(t=>void 0!==t[Symbol.asyncIterator])?function(t){return o(this,arguments,(function*(){var e,n;try{for(var o,u=l(t);!(o=yield r(u.next())).done;){const t=o.value;yield r(yield*i(l(t)))}}catch(c){e={error:c}}finally{try{o&&!o.done&&(n=u.return)&&(yield r(n.call(u)))}finally{if(e)throw e.error}}}))}(t):function*(t){for(const e of t)yield*e}(t)},e.consume=function(t){if(t[Symbol.asyncIterator])return async function(t){var e,n;try{for(var r,o=l(t);!(r=await o.next()).done;){r.value}}catch(i){e={error:i}}finally{try{r&&!r.done&&(n=o.return)&&await n.call(o)}finally{if(e)throw e.error}}}(t)},e.filter=y,e.flatMap=function t(e,n){if(void 0===n)return n=>t(e,n);return y(t=>null!=t,d(v(e,n)))},e.flatten=d,e.flatTransform=function t(e,n,r){if(void 0===n)return(n,r)=>r?t(e,n,r):t(e,n);if(void 0===r)return r=>t(e,n,r);return y(t=>null!=t,d(function(t,e,n){const r=u(n),o=[],i=[];let a=!1,f=!1,s=0,y=null;function d(){for(;i.length>0&&o.length>0;){const{resolve:t}=i.shift();t({done:!1,value:o.shift()})}for(;i.length>0&&0===s&&a;){const{resolve:t,reject:e}=i.shift();y?(e(y),y=null):t({done:!0,value:void 0})}}async function h(){if(a)d();else if(!(f||s+o.length>=t)){f=!0,s++;try{const{done:t,value:n}=await r.next();t?(a=!0,s--,d()):async function(t){var n,r;try{const a=await e(t);if(a&&a[Symbol.asyncIterator])try{for(var i,u=l(a);!(i=await u.next()).done;){const t=i.value;o.push(t)}}catch(c){n={error:c}}finally{try{i&&!i.done&&(r=u.return)&&await r.call(u)}finally{if(n)throw n.error}}else o.push(a)}catch(f){a=!0,y=f}s--,d(),h()}(n)}catch(n){a=!0,s--,y=n,d()}f=!1,h()}}const v={next:async function(){if(0===o.length){const t=c();return i.push(t),h(),t.promise}const t=o.shift();return h(),{done:!1,value:t}},[Symbol.asyncIterator]:()=>v};return v}(e,n,r)))},e.fromStream=function(t){if("function"==typeof t[Symbol.asyncIterator])return t;return function(t){return o(this,arguments,(function*(){for(;;){const e=t.read();if(null===e){if(t._readableState.ended)return yield r(void 0);yield r(p(t))}else yield yield r(e)}}))}(t)},e.getIterator=u,e.map=v,e.merge=function(...t){return o(this,arguments,(function*(){const e=new Set(t.map(u));for(;e.size>0;)for(const t of e){const n=yield r(t.next());n.done?e.delete(t):yield yield r(n.value)}}))},e.parallelFlatMap=function t(e,n,r){if(void 0===n)return(n,r)=>r?t(e,n,r):t(e,n);if(void 0===r)return r=>t(e,n,r);return y(t=>null!=t,d(w(e,n,r)))},e.parallelMap=w,e.parallelMerge=function(...t){return o(this,arguments,(function*(){const e=t.map(u),n=new Set,o=new Map;let i=null,l=null,c=null;const a=t=>{i=t,l&&l(t)},f=t=>{c&&c(t)},s=t=>{const e=Promise.resolve(t.next()).then(async({done:r,value:i})=>{r||o.set(t,i),n.delete(e)});n.add(e),e.then(f,a)};for(const t of e)s(t);for(;;){if(0===n.size&&0===o.size)return yield r(void 0);yield r(new Promise((t,e)=>{if(i&&e(i),o.size>0)return t();c=t,l=e}));for(const[t,e]of o)o.delete(t),yield yield r(e),s(t)}}))},e.pipeline=m,e.reduce=function t(e,n,r){if(void 0===n)return(n,r)=>r?t(e,n,r):t(e,n);if(void 0===r)return r=>t(e,n,r);return async function(t,e,n){var r,o;let i=e;try{for(var u,c=l(n);!(u=await c.next()).done;){const e=u.value;i=await t(i,e)}}catch(a){r={error:a}}finally{try{u&&!u.done&&(o=c.return)&&await o.call(c)}finally{if(r)throw r.error}}return i}(e,n,r)},e.take=function t(e,n){if(void 0===n)return n=>t(e,n);if(n[Symbol.asyncIterator])return function(t,e){return o(this,arguments,(function*(){var n,o;let i=0;try{for(var u,c=l(e);!(u=yield r(c.next())).done;){const e=u.value;if(yield yield r(yield r(e)),i++,i>=t)return yield r(void 0)}}catch(a){n={error:a}}finally{try{u&&!u.done&&(o=c.return)&&(yield r(o.call(c)))}finally{if(n)throw n.error}}}))}(e,n);return function*(t,e){let n=0;for(const r of e)if(yield r,n++,n>=t)return}(e,n)},e.tap=function(t,e){if(void 0===e)return e=>b(t,e);return b(t,e)},e.time=function e(n={},i){if(void 0===i)return t=>e(n,t);return void 0!==i[Symbol.asyncIterator]?function(e,n){return o(this,arguments,(function*(){const o=n[Symbol.asyncIterator]();let i=[0,0];for(;;){const n=t.hrtime(),{value:l,done:u}=yield r(o.next()),c=t.hrtime(n);if(i=g(i,c),e.progress&&e.progress(c,i),u)return e.total&&e.total(i),yield r(l);yield yield r(l)}}))}(n,i):function*(e,n){const r=n[Symbol.iterator]();let o=[0,0];for(;;){const n=t.hrtime(),{value:i,done:l}=r.next(),u=t.hrtime(n);if(o=g(o,u),e.progress&&e.progress(u,o),l)return e.total&&e.total(o),i;yield i}}(n,i)},e.transform=function t(e,n,r){if(void 0===n)return(n,r)=>r?t(e,n,r):t(e,n);if(void 0===r)return r=>t(e,n,r);return function(t,e,n){const r=u(n),o=[],i=[];let l=!1,a=!1,f=0,s=null;function y(){for(;i.length>0&&o.length>0;){const{resolve:t}=i.shift();t({done:!1,value:o.shift()})}for(;i.length>0&&0===f&&l;){const{resolve:t,reject:e}=i.shift();s?(e(s),s=null):t({done:!0,value:void 0})}}async function d(){if(l)y();else if(!(a||f+o.length>=t)){a=!0,f++;try{const{done:t,value:n}=await r.next();t?(l=!0,f--,y()):async function(t){try{const n=await e(t);o.push(n)}catch(n){l=!0,s=n}f--,y(),d()}(n)}catch(n){l=!0,f--,s=n,y()}a=!1,d()}}const h={next:async function(){if(0===o.length){const t=c();return i.push(t),d(),t.promise}const t=o.shift();return d(),{done:!1,value:t}},[Symbol.asyncIterator]:()=>h};return h}(e,n,r)},e.writeToStream=function(t,e){if(void 0===e)return e=>x(t,e);return x(t,e)},void 0===Symbol.asyncIterator&&(Symbol.asyncIterator=Symbol.for("asyncIterator"))}).call(this,n(3))},function(t,e,n){"use strict";var r,o,i=t.exports={};function l(){throw new Error("setTimeout has not been defined")}function u(){throw new Error("clearTimeout has not been defined")}function c(t){if(r===setTimeout)return setTimeout(t,0);if((r===l||!r)&&setTimeout)return r=setTimeout,setTimeout(t,0);try{return r(t,0)}catch(e){try{return r.call(null,t,0)}catch(e){return r.call(this,t,0)}}}!function(){try{r="function"==typeof setTimeout?setTimeout:l}catch(t){r=l}try{o="function"==typeof clearTimeout?clearTimeout:u}catch(t){o=u}}();var a,f=[],s=!1,y=-1;function d(){s&&a&&(s=!1,a.length?f=a.concat(f):y=-1,f.length&&h())}function h(){if(!s){var t=c(d);s=!0;for(var e=f.length;e;){for(a=f,f=[];++y<e;)a&&a[y].run();y=-1,e=f.length}a=null,s=!1,function(t){if(o===clearTimeout)return clearTimeout(t);if((o===u||!o)&&clearTimeout)return o=clearTimeout,clearTimeout(t);try{o(t)}catch(e){try{return o.call(null,t)}catch(e){return o.call(this,t)}}}(t)}}function v(t,e){this.fun=t,this.array=e}function p(){}i.nextTick=function(t){var e=new Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)e[n-1]=arguments[n];f.push(new v(t,e)),1!==f.length||s||c(h)},v.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=p,i.addListener=p,i.once=p,i.off=p,i.removeListener=p,i.removeAllListeners=p,i.emit=p,i.prependListener=p,i.prependOnceListener=p,i.listeners=function(t){return[]},i.binding=function(t){throw new Error("process.binding is not supported")},i.cwd=function(){return"/"},i.chdir=function(t){throw new Error("process.chdir is not supported")},i.umask=function(){return 0}},function(t,e,n){"use strict";t.exports=function(t,e,n){var r;if(!(t instanceof Error))throw new TypeError("Please pass an Error to err-code");if("object"==typeof e?n=e:null!=e&&(t.code=e),n)for(r in n)t[r]=n[r];return t}}])}));
//# sourceMappingURL=index.min.js.map
{
"name": "ipfs-block-service",
"version": "0.16.0",
"version": "0.17.0",
"description": "JavaScript Implementation of BlockService",

@@ -33,11 +33,13 @@ "leadMaintainer": "Volker Mische <volker.mische@gmail.com>",

"devDependencies": {
"aegir": "^19.0.3",
"abort-controller": "^3.0.0",
"aegir": "^21.8.1",
"chai": "^4.2.0",
"cids": "~0.7.1",
"chai-as-promised": "^7.1.1",
"cids": "^0.8.0",
"dirty-chai": "^2.0.1",
"fs-extra": "^8.0.1",
"fs-extra": "^9.0.0",
"ipfs-block": "~0.8.1",
"ipfs-repo": "~0.27.0",
"ipfs-repo": "^1.0.1",
"lodash": "^4.17.11",
"multihashing-async": "~0.7.0"
"multihashing-async": "^0.8.1"
},

@@ -49,2 +51,3 @@ "engines": {

"dependencies": {
"err-code": "^2.0.0",
"streaming-iterables": "^4.1.0"

@@ -54,14 +57,12 @@ },

"David Dias <daviddias.p@gmail.com>",
"dignifiedquire <dignifiedquire@gmail.com>",
"Stephen Whitmore <stephen.whitmore@gmail.com>",
"Volker Mische <volker.mische@gmail.com>",
"Alex Potsides <alex@achingbrain.net>",
"Richard Schneider <makaretu@gmail.com>",
"Pedro Teixeira <i@pgte.me>",
"Dirk McCormick <dirkmdev@gmail.com>",
"Friedel Ziegelmayer <dignifiedquire@gmail.com>",
"Greenkeeper <support@greenkeeper.io>",
"Pedro Santos <pedro.santos@moxy.studio>",
"Pedro Teixeira <i@pgte.me>",
"Richard Littauer <richard.littauer@gmail.com>",
"Richard Schneider <makaretu@gmail.com>",
"Stephen Whitmore <stephen.whitmore@gmail.com>",
"Volker Mische <volker.mische@gmail.com>",
"achingbrain <alex@achingbrain.net>",
"greenkeeper[bot] <greenkeeper[bot]@users.noreply.github.com>",
"npmcdn-to-unpkg-bot <npmcdn-to-unpkg-bot@users.noreply.github.com>",
"Vijayee Kulkaa <vijayee.kulkaa@hushmail.com>",
"wanderer <mjbecze@gmail.com>",

@@ -68,0 +69,0 @@ "ᴠɪᴄᴛᴏʀ ʙᴊᴇʟᴋʜᴏʟᴍ <victorbjelkholm@gmail.com>"

'use strict'
const { map } = require('streaming-iterables')
const errcode = require('err-code')

@@ -57,9 +58,11 @@ /**

* @param {Block} block
* @param {Object} [options] - Options is an object with the following properties
* @param {AbortSignal} [options.signal] - A signal that can be used to abort any long-lived operations that are started as a result of this operation
* @returns {Promise}
*/
put (block) {
put (block, options) {
if (this.hasExchange()) {
return this._bitswap.put(block)
return this._bitswap.put(block, options)
} else {
return this._repo.blocks.put(block)
return this._repo.blocks.put(block, options)
}

@@ -72,9 +75,11 @@ }

* @param {Array<Block>} blocks
* @param {Object} [options] - Options is an object with the following properties
* @param {AbortSignal} [options.signal] - A signal that can be used to abort any long-lived operations that are started as a result of this operation
* @returns {Promise}
*/
putMany (blocks) {
putMany (blocks, options) {
if (this.hasExchange()) {
return this._bitswap.putMany(blocks)
return this._bitswap.putMany(blocks, options)
} else {
return this._repo.blocks.putMany(blocks)
return this._repo.blocks.putMany(blocks, options)
}

@@ -87,9 +92,11 @@ }

* @param {CID} cid
* @param {Object} [options] - Options is an object with the following properties
* @param {AbortSignal} [options.signal] - A signal that can be used to abort any long-lived operations that are started as a result of this operation
* @returns {Promise<Block>}
*/
get (cid) {
get (cid, options) {
if (this.hasExchange()) {
return this._bitswap.get(cid)
return this._bitswap.get(cid, options)
} else {
return this._repo.blocks.get(cid)
return this._repo.blocks.get(cid, options)
}

@@ -102,5 +109,7 @@ }

* @param {Array<CID>} cids
* @param {Object} [options] - Options is an object with the following properties
* @param {AbortSignal} [options.signal] - A signal that can be used to abort any long-lived operations that are started as a result of this operation
* @returns {Iterator<Block>}
*/
getMany (cids) {
getMany (cids, options) {
if (!Array.isArray(cids)) {

@@ -111,5 +120,5 @@ throw new Error('first arg must be an array of cids')

if (this.hasExchange()) {
return this._bitswap.getMany(cids)
return this._bitswap.getMany(cids, options)
} else {
const getRepoBlocks = map((cid) => this._repo.blocks.get(cid))
const getRepoBlocks = map((cid) => this._repo.blocks.get(cid, options))
return getRepoBlocks(cids)

@@ -123,6 +132,12 @@ }

* @param {CID} cid
* @param {Object} [options] - Options is an object with the following properties
* @param {AbortSignal} [options.signal] - A signal that can be used to abort any long-lived operations that are started as a result of this operation
* @returns {Promise}
*/
delete (cid) {
return this._repo.blocks.delete(cid)
async delete (cid, options) {
if (!await this._repo.blocks.has(cid)) {
throw errcode(new Error('blockstore: block not found'), 'ERR_BLOCK_NOT_FOUND')
}
return this._repo.blocks.delete(cid, options)
}

@@ -129,0 +144,0 @@ }

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

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

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

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc