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.17.1 to 0.18.0

16

CHANGELOG.md

@@ -0,1 +1,17 @@

<a name="0.18.0"></a>
# [0.18.0](https://github.com/ipfs/js-ipfs-block-service/compare/v0.17.1...v0.18.0) (2020-08-05)
### Bug Fixes
* replace node buffers with uint8arrays ([#105](https://github.com/ipfs/js-ipfs-block-service/issues/105)) ([804c5cf](https://github.com/ipfs/js-ipfs-block-service/commit/804c5cf))
### BREAKING CHANGES
* - All uses of Buffers have been replaced with Uint8Arrays
- The ipfs-repo this module uses only returns Uint8Arrays
<a name="0.17.1"></a>

@@ -2,0 +18,0 @@ ## [0.17.1](https://github.com/ipfs/js-ipfs-block-service/compare/v0.17.0...v0.17.1) (2020-05-05)

4

dist/index.min.js

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

/*! 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";function r(t){return new i(t)}function o(t){var e,n;function r(e,n){try{var l=t[e](n),u=l.value,c=u instanceof i;Promise.resolve(c?u.wrapped:u).then((function(t){c?r("return"===e?"return":"next",t):o(l.done?"return":"normal",t)}),(function(t){r("throw",t)}))}catch(a){o("throw",a)}}function o(t,o){switch(t){case"return":e.resolve({value:o,done:!0});break;case"throw":e.reject(o);break;default:e.resolve({value:o,done:!1})}(e=e.next)?r(e.key,e.arg):n=null}this._invoke=function(t,o){return new Promise((function(i,l){var u={key:t,arg:o,resolve:i,reject:l,next:null};n?n=n.next=u:(e=n=u,r(t,o))}))},"function"!=typeof t.return&&(this.return=void 0)}function i(t){this.wrapped=t}"function"==typeof Symbol&&Symbol.asyncIterator&&(o.prototype[Symbol.asyncIterator]=function(){return this}),o.prototype.next=function(t){return this._invoke("next",t)},o.prototype.throw=function(t){return this._invoke("throw",t)},o.prototype.return=function(t){return this._invoke("return",t)};const{map:l}=n(2),u=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 l(t=>this._repo.blocks.get(t,e))(t)}async delete(t,e){if(!await this._repo.blocks.has(t))throw u(new Error("blockstore: block not found"),"ERR_BLOCK_NOT_FOUND");return this._repo.blocks.delete(t,e)}deleteMany(t,e){const n=this._repo;return this._repo.blocks.deleteMany((i=function*(){var e,o=!0,i=!1;try{for(var l,c,a=function(t){var e;if("undefined"!=typeof Symbol){if(Symbol.asyncIterator&&null!=(e=t[Symbol.asyncIterator]))return e.call(t);if(Symbol.iterator&&null!=(e=t[Symbol.iterator]))return e.call(t)}throw new TypeError("Object is not async iterable")}(t);o=(l=yield r(a.next())).done,c=yield r(l.value),!o;o=!0){const t=c;if(!(yield r(n.blocks.has(t))))throw u(new Error("blockstore: block not found"),"ERR_BLOCK_NOT_FOUND");yield t}}catch(f){i=!0,e=f}finally{try{o||null==a.return||(yield r(a.return()))}finally{if(i)throw e}}},function(){return new o(i.apply(this,arguments))})(),e);var i}}},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
!function(t,n){"object"==typeof exports&&"object"==typeof module?module.exports=n():"function"==typeof define&&define.amd?define([],n):"object"==typeof exports?exports.IpfsBlockService=n():t.IpfsBlockService=n()}(window,(function(){return function(t){var n={};function e(o){if(n[o])return n[o].exports;var r=n[o]={i:o,l:!1,exports:{}};return t[o].call(r.exports,r,r.exports,e),r.l=!0,r.exports}return e.m=t,e.c=n,e.d=function(t,n,o){e.o(t,n)||Object.defineProperty(t,n,{enumerable:!0,get:o})},e.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},e.t=function(t,n){if(1&n&&(t=e(t)),8&n)return t;if(4&n&&"object"==typeof t&&t&&t.__esModule)return t;var o=Object.create(null);if(e.r(o),Object.defineProperty(o,"default",{enumerable:!0,value:t}),2&n&&"string"!=typeof t)for(var r in t)e.d(o,r,function(n){return t[n]}.bind(null,r));return o},e.n=function(t){var n=t&&t.__esModule?function(){return t.default}:function(){return t};return e.d(n,"a",n),n},e.o=function(t,n){return Object.prototype.hasOwnProperty.call(t,n)},e.p="",e(e.s=0)}([function(t,n,e){t.exports=e(1)},function(t,n,e){"use strict";const{map:o}=e(2),r=e(3);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,n){return this.hasExchange()?this._bitswap.put(t,n):this._repo.blocks.put(t,n)}putMany(t,n){return this.hasExchange()?this._bitswap.putMany(t,n):this._repo.blocks.putMany(t,n)}get(t,n){return this.hasExchange()?this._bitswap.get(t,n):this._repo.blocks.get(t,n)}getMany(t,n){if(!Array.isArray(t))throw new Error("first arg must be an array of cids");if(this.hasExchange())return this._bitswap.getMany(t,n);return o(t=>this._repo.blocks.get(t,n))(t)}async delete(t,n){if(!await this._repo.blocks.has(t))throw r(new Error("blockstore: block not found"),"ERR_BLOCK_NOT_FOUND");return this._repo.blocks.delete(t,n)}deleteMany(t,n){const e=this._repo;return this._repo.blocks.deleteMany(async function*(){for await(const n of t){if(!await e.blocks.has(n))throw r(new Error("blockstore: block not found"),"ERR_BLOCK_NOT_FOUND");yield n}}(),n)}}},function(t,n,e){"use strict";function o(t,n){return void 0===n?n=>o(t,n):n[Symbol.asyncIterator]?async function*(t,n){let e=[];for await(const o of n)e.push(o),e.length===t&&(yield e,e=[]);e.length>0&&(yield e)}(t,n):function*(t,n){let e=[];for(const o of n)e.push(o),e.length===t&&(yield e,e=[]);e.length>0&&(yield e)}(t,n)}function r(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 i(){let t,n;return{promise:new Promise((e,o)=>{n=e,t=o}),reject:t,resolve:n}}function c(t,n){const e=r(n),o=[],c=[];let u=!1,s=!1;async function a(){if(!s&&!(u||o.length>=t)){u=!0;try{const{done:t,value:n}=await e.next();t?s=!0:o.push({value:n})}catch(n){s=!0,o.push({error:n})}!function(){for(;c.length>0&&o.length>0;){const t=c.shift(),{error:n,value:e}=o.shift();n?t.reject(n):t.resolve({done:!1,value:e})}for(;c.length>0&&s;){const{resolve:t}=c.shift();t({done:!0,value:void 0})}}(),u=!1,a()}}const f={next:async function(){if(o.length>0){const{error:t,value:n}=o.shift();if(t)throw t;return a(),{done:!1,value:n}}if(s)return{done:!0,value:void 0};const t=i();return c.push(t),a(),t.promise},[Symbol.asyncIterator]:()=>f};return f}function u(t,n){return void 0===n?n=>u(t,n):n[Symbol.asyncIterator]?c(t,n):function*(t,n){const e=[];let o;try{for(const o of n)e.push(o),e.length<=t||(yield e.shift())}catch(r){o=r}for(const i of e)yield i;if(o)throw o}(t,n)}function s(t){return t[Symbol.asyncIterator]?async function(t){const n=[];for await(const e of t)n.push(e);return n}(t):Array.from(t)}function a(...t){return t.find(t=>void 0!==t[Symbol.asyncIterator])?async function*(t){for await(const n of t)yield*n}(t):function*(t){for(const n of t)yield*n}(t)}function f(t){if(t[Symbol.asyncIterator])return async function(t){for await(const n of t);}(t);for(const n of t);}async function*l(t,n){for await(const e of n)await t(e)&&(yield e)}function d(t,n){return void 0===n?n=>l(t,n):l(t,n)}async function*y(t){for await(const n of t)n&&"string"!=typeof n&&(n[Symbol.iterator]||n[Symbol.asyncIterator])?yield*y(n):yield n}async function*h(t,n){for await(const e of n)yield await t(e)}function p(t,n){return void 0===n?n=>h(t,n):h(t,n)}function b(t,n){return void 0===n?n=>b(t,n):d(t=>null!=t,y(p(t,n)))}function v(t,n,e){const o=r(e),c=[],u=[];let s=!1,a=!1,f=0,l=null;function d(){for(;u.length>0&&c.length>0;){const{resolve:t}=u.shift();t({done:!1,value:c.shift()})}for(;u.length>0&&0===f&&s;){const{resolve:t,reject:n}=u.shift();l?(n(l),l=null):t({done:!0,value:void 0})}}async function y(){if(s)d();else if(!(a||f+c.length>=t)){a=!0,f++;try{const{done:t,value:e}=await o.next();t?(s=!0,f--,d()):async function(t){try{const e=await n(t);if(e&&e[Symbol.asyncIterator])for await(const t of e)c.push(t);else c.push(e)}catch(e){s=!0,l=e}f--,d(),y()}(e)}catch(e){s=!0,f--,l=e,d()}a=!1,y()}}const h={next:async function(){if(0===c.length){const t=i();return u.push(t),y(),t.promise}const t=c.shift();return y(),{done:!1,value:t}},[Symbol.asyncIterator]:()=>h};return h}function w(t,n,e){return void 0===n?(n,e)=>e?w(t,n,e):w(t,n):void 0===e?e=>w(t,n,e):d(t=>null!=t,y(v(t,n,e)))}async function m(t){return new Promise(n=>{t.once("readable",()=>{n()})})}function g(t){return"function"==typeof t[Symbol.asyncIterator]?t:async function*(t){for(;;){const n=t.read();if(null===n){if(t._readableState.ended)break;await m(t)}else yield n}}(t)}async function*S(...t){const n=new Set(t.map(r));for(;n.size>0;)for(const t of n){const e=await t.next();e.done?n.delete(t):yield e.value}}function x(t,...n){let e=t();for(const o of n)e=o(e);return e}function _(t,n,e){return void 0===n?(n,e)=>_(t,n,e):void 0===e?e=>_(t,n,e):async function*(t,n,e){let o=null;const i=r(x(()=>e,u(1),(async function*(t){for await(const n of t){if(o)return;yield n}}),p(t=>({value:n(t)})),u(t)));for(;;){const{value:t,done:n}=await i.next();if(n)break;try{const n=await t.value;o||(yield n)}catch(c){o=c}}if(o)throw o}(t,n,e)}function k(t,n,e){return void 0===n?(n,e)=>e?k(t,n,e):k(t,n):void 0===e?e=>k(t,n,e):d(t=>null!=t,y(_(t,n,e)))}async function*I(...t){const n=t.map(r),e=new Set,o=new Map;let i=null,c=null,u=null;const s=t=>{i=t,c&&c(t)},a=t=>{u&&u(t)},f=t=>{const n=Promise.resolve(t.next()).then(async({done:r,value:i})=>{r||o.set(t,i),e.delete(n)});e.add(n),n.then(a,s)};for(const r of n)f(r);for(;;){if(0===e.size&&0===o.size)return;await new Promise((t,n)=>{if(i&&n(i),o.size>0)return t();u=t,c=n});for(const[t,n]of o)o.delete(t),yield n,f(t)}}async function j(t,n,e){let o=n;for await(const r of e)o=await t(o,r);return o}function O(t,n,e){return void 0===n?(n,e)=>e?j(t,n,e):O(t,n):void 0===e?e=>O(t,n,e):j(t,n,e)}function M(t,n){return void 0===n?n=>M(t,n):n[Symbol.asyncIterator]?async function*(t,n){let e=0;for await(const o of n)if(yield await o,e++,e>=t)break}(t,n):function*(t,n){let e=0;for(const o of n)if(yield o,e++,e>=t)break}(t,n)}async function*E(t,n){for await(const e of n)await t(e),yield e}function P(t,n){return void 0===n?n=>E(t,n):E(t,n)}function T(t,n){let e=t[0]+n[0],o=t[1]+n[1];if(o>=1e9){const t=o%1e9;e+=(o-t)/1e9,o=t}return[e,o]}function z(t={},n){return void 0===n?n=>z(t,n):void 0!==n[Symbol.asyncIterator]?async function*(t,n){const e=n[Symbol.asyncIterator]();let o=[0,0];for(;;){const n=process.hrtime(),{value:r,done:i}=await e.next(),c=process.hrtime(n);if(o=T(o,c),t.progress&&t.progress(c,o),i)return t.total&&t.total(o),r;yield r}}(t,n):function*(t,n){const e=n[Symbol.iterator]();let o=[0,0];for(;;){const n=process.hrtime(),{value:r,done:i}=e.next(),c=process.hrtime(n);if(o=T(o,c),t.progress&&t.progress(c,o),i)return t.total&&t.total(o),r;yield r}}(t,n)}function B(t,n,e){const o=r(e),c=[],u=[];let s=!1,a=!1,f=0,l=null;function d(){for(;u.length>0&&c.length>0;){const{resolve:t}=u.shift();t({done:!1,value:c.shift()})}for(;u.length>0&&0===f&&s;){const{resolve:t,reject:n}=u.shift();l?(n(l),l=null):t({done:!0,value:void 0})}}async function y(){if(s)d();else if(!(a||f+c.length>=t)){a=!0,f++;try{const{done:t,value:e}=await o.next();t?(s=!0,f--,d()):async function(t){try{const e=await n(t);c.push(e)}catch(e){s=!0,l=e}f--,d(),y()}(e)}catch(e){s=!0,f--,l=e,d()}a=!1,y()}}const h={next:async function(){if(0===c.length){const t=i();return u.push(t),y(),t.promise}const t=c.shift();return y(),{done:!1,value:t}},[Symbol.asyncIterator]:()=>h};return h}function L(t,n,e){return void 0===n?(n,e)=>e?L(t,n,e):L(t,n):void 0===e?e=>L(t,n,e):B(t,n,e)}async function N(t,n){let e=null,o=null,r=null;const i=t=>{e=t,o&&o(t)},c=()=>{r&&r()};t.once("error",i);for await(const u of n)if(!1===t.write(u)&&await new Promise((n,i)=>{if(e)return i(e);t.once("drain",c),r=n,o=i}),e)break;if(t.removeListener("error",i),t.removeListener("drain",c),e)throw e}function R(t,n){return void 0===n?n=>N(t,n):N(t,n)}e.r(n),e.d(n,"batch",(function(){return o})),e.d(n,"buffer",(function(){return u})),e.d(n,"collect",(function(){return s})),e.d(n,"concat",(function(){return a})),e.d(n,"consume",(function(){return f})),e.d(n,"filter",(function(){return d})),e.d(n,"flatMap",(function(){return b})),e.d(n,"flatTransform",(function(){return w})),e.d(n,"flatten",(function(){return y})),e.d(n,"fromStream",(function(){return g})),e.d(n,"getIterator",(function(){return r})),e.d(n,"map",(function(){return p})),e.d(n,"merge",(function(){return S})),e.d(n,"parallelFlatMap",(function(){return k})),e.d(n,"parallelMap",(function(){return _})),e.d(n,"parallelMerge",(function(){return I})),e.d(n,"pipeline",(function(){return x})),e.d(n,"reduce",(function(){return O})),e.d(n,"take",(function(){return M})),e.d(n,"tap",(function(){return P})),e.d(n,"time",(function(){return z})),e.d(n,"transform",(function(){return L})),e.d(n,"writeToStream",(function(){return R}))},function(t,n,e){"use strict";function o(t,n){for(const e in n)Object.defineProperty(t,e,{value:n[e],enumerable:!0,configurable:!0});return t}t.exports=function(t,n,e){if(!t||"string"==typeof t)throw new TypeError("Please pass an Error to err-code");e||(e={}),"object"==typeof n&&(e=n,n=void 0),null!=n&&(e.code=n);try{return o(t,e)}catch(r){e.message=t.message,e.stack=t.stack;const n=function(){};return n.prototype=Object.create(Object.getPrototypeOf(t)),o(new n,e)}}}])}));

@@ -9,3 +9,3 @@ /*!

// https://github.com/umdjs/umd/blob/master/templates/returnExports.js
(function(root, factory) {
(function (root, factory) {
'use strict';

@@ -25,3 +25,3 @@ if (typeof define === 'function' && define.amd) {

}
})(this, function() {
})(this, function () {
'use strict';

@@ -56,3 +56,3 @@ function AnchorJS(options) {

*/
this.isTouchDevice = function() {
this.isTouchDevice = function () {
return !!(

@@ -70,3 +70,3 @@ 'ontouchstart' in window ||

*/
this.add = function(selector) {
this.add = function (selector) {
var elements,

@@ -200,3 +200,3 @@ elsWithIds,

*/
this.remove = function(selector) {
this.remove = function (selector) {
var index,

@@ -224,3 +224,3 @@ domAnchor,

*/
this.removeAll = function() {
this.removeAll = function () {
this.remove(this.elements);

@@ -238,3 +238,3 @@ };

*/
this.urlify = function(text) {
this.urlify = function (text) {
// Regex for finding the nonsafe URL characters (many need escaping): & +$,:;=?@"#{}|^~[`%!'<>]./()*\

@@ -270,3 +270,3 @@ var nonsafeChars = /[& +$,:;=?@"#{}|^~[`%!'<>\]\.\/\(\)\*\\]/g,

*/
this.hasAnchorJSLink = function(el) {
this.hasAnchorJSLink = function (el) {
var hasLeftAnchor =

@@ -273,0 +273,0 @@ el.firstChild &&

@@ -10,3 +10,3 @@ /* global anchors */

document.getElementById('filter-input').addEventListener('keyup', function(e) {
document.getElementById('filter-input').addEventListener('keyup', function (e) {
var i, element, children;

@@ -26,3 +26,3 @@

var match = function() {
var match = function () {
return true;

@@ -34,3 +34,3 @@ };

if (!value.match(/^\s*$/)) {
match = function(element) {
match = function (element) {
var html = element.firstChild.innerHTML;

@@ -120,3 +120,3 @@ return html && html.toLowerCase().indexOf(value) !== -1;

Split(['#split-left', '#split-right'], {
elementStyle: function(dimension, size, gutterSize) {
elementStyle: function (dimension, size, gutterSize) {
return {

@@ -126,3 +126,3 @@ 'flex-basis': 'calc(' + size + '% - ' + gutterSize + 'px)'

},
gutterStyle: function(dimension, gutterSize) {
gutterStyle: function (dimension, gutterSize) {
return {

@@ -160,5 +160,5 @@ 'flex-basis': gutterSize + 'px'

window.addEventListener('load', function() {
window.addEventListener('load', function () {
// Restore after Firefox scrolls to hash.
setTimeout(function() {
setTimeout(function () {
loadState();

@@ -165,0 +165,0 @@ // Update with initial scroll position.

{
"name": "ipfs-block-service",
"version": "0.17.1",
"version": "0.18.0",
"description": "JavaScript Implementation of BlockService",

@@ -34,15 +34,14 @@ "leadMaintainer": "Volker Mische <volker.mische@gmail.com>",

"abort-controller": "^3.0.0",
"aegir": "^21.8.1",
"chai": "^4.2.0",
"chai-as-promised": "^7.1.1",
"cids": "^0.8.0",
"dirty-chai": "^2.0.1",
"aegir": "^22.0.0",
"cids": "^1.0.0",
"fs-extra": "^9.0.0",
"ipfs-repo": "^2.1.0",
"ipld-block": "^0.9.1",
"ipfs-repo": "^6.0.0",
"ipld-block": "^0.10.0",
"it-drain": "^1.0.1",
"lodash": "^4.17.11",
"multihashing-async": "^0.8.1"
"multihashing-async": "^2.0.1",
"uint8arrays": "^1.0.0"
},
"engines": {
"node": ">=6.0.0",
"node": ">=12.0.0",
"npm": ">=3.0.0"

@@ -52,3 +51,3 @@ },

"err-code": "^2.0.0",
"streaming-iterables": "^4.1.0"
"streaming-iterables": "^5.0.2"
},

@@ -58,7 +57,8 @@ "contributors": [

"dignifiedquire <dignifiedquire@gmail.com>",
"Volker Mische <volker.mische@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>",
"Bryan Stenson <bryan.stenson@gmail.com>",
"Dirk McCormick <dirkmdev@gmail.com>",

@@ -65,0 +65,0 @@ "Hector Sanjuan <code@hector.link>",

@@ -72,2 +72,4 @@ # IPFS Block Service

const IPFSRepo = require('ipfs-repo') // storage repo
const uint8ArrayEquals = require('uint8arrays/equals')
const uint8ArrayFromString = require('uint8arrays/from-string')

@@ -78,3 +80,3 @@ // setup a repo

// create a block
const data = new Buffer('hello world')
const data = uint8ArrayFromString('hello world')
const multihash = await multihashing(data, 'sha2-256')

@@ -92,3 +94,3 @@

const result = await service.get(cid)
console.log(block.data.toString() === result.data.toString())
console.log(uint8ArrayEquals(block.data, result.data))
// => true

@@ -124,3 +126,3 @@ ```

[![](https://cdn.rawgit.com/jbenet/contribute-ipfs-gif/master/img/contribute.gif)](https://github.com/ipfs/community/blob/master/contributing.md)
[![](https://cdn.rawgit.com/jbenet/contribute-ipfs-gif/master/img/contribute.gif)](https://github.com/ipfs/community/blob/master/CONTRIBUTING.md)

@@ -127,0 +129,0 @@ ## License

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