@helia/strings 1.0.1 → 2.0.0-3f4c6bf

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -4,30 +4,43 @@
4
4
  </a>
5
5
  </p>
6
6
 
7
- # @helia/strings <!-- omit in toc -->
7
+ # @helia/strings
8
8
 
9
9
  [![ipfs.tech](https://img.shields.io/badge/project-IPFS-blue.svg?style=flat-square)](https://ipfs.tech)
10
10
  [![Discuss](https://img.shields.io/discourse/https/discuss.ipfs.tech/posts.svg?style=flat-square)](https://discuss.ipfs.tech)
11
- [![codecov](https://img.shields.io/codecov/c/github/ipfs/helia-strings.svg?style=flat-square)](https://codecov.io/gh/ipfs/helia-strings)
12
- [![CI](https://img.shields.io/github/actions/workflow/status/ipfs/helia-strings/js-test-and-release.yml?branch=main\&style=flat-square)](https://github.com/ipfs/helia-strings/actions/workflows/js-test-and-release.yml?query=branch%3Amain)
11
+ [![codecov](https://img.shields.io/codecov/c/github/ipfs/helia.svg?style=flat-square)](https://codecov.io/gh/ipfs/helia)
12
+ [![CI](https://img.shields.io/github/actions/workflow/status/ipfs/helia/main.yml?branch=main\&style=flat-square)](https://github.com/ipfs/helia/actions/workflows/main.yml?query=branch%3Amain)
13
13
 
14
14
  > Add/get IPLD blocks containing strings with your Helia node
15
15
 
16
- ## Table of contents <!-- omit in toc -->
16
+ # About
17
17
 
18
- - [Install](#install)
19
- - [Browser `<script>` tag](#browser-script-tag)
20
- - [API Docs](#api-docs)
21
- - [License](#license)
22
- - [Contribute](#contribute)
18
+ `@helia/strings` makes working with strings Helia simple & straightforward.
23
19
 
24
- ## Install
20
+ See the [API docs](https://ipfs.github.io/helia/modules/_helia_strings.html) for all available operations.
21
+
22
+ ## Example
23
+
24
+ ```typescript
25
+ import { createHelia } from 'helia'
26
+ import { strings } from '@helia/strings'
27
+ import { CID } from 'multiformats/cid'
28
+
29
+ const str = strings(helia)
30
+ const cid = await str.put('hello world')
31
+ const string = await str.get(cid)
32
+
33
+ console.info(string)
34
+ // hello world
35
+ ```
36
+
37
+ # Install
25
38
 
26
39
  ```console
27
40
  $ npm i @helia/strings
28
41
  ```
29
42
 
30
- ### Browser `<script>` tag
43
+ ## Browser `<script>` tag
31
44
 
32
45
  Loading this module through a script tag will make it's exports available as `HeliaStrings` in the global namespace.
33
46
 
@@ -35,20 +48,20 @@ Loading this module through a script tag will make it's exports available as `He
35
48
  <script src="https://unpkg.com/@helia/strings/dist/index.min.js"></script>
36
49
  ```
37
50
 
38
- ## API Docs
51
+ # API Docs
39
52
 
40
- - <https://ipfs.github.io/helia-strings/modules/_helia_strings.html>
53
+ - <https://ipfs.github.io/helia/modules/_helia_strings.html>
41
54
 
42
- ## License
55
+ # License
43
56
 
44
57
  Licensed under either of
45
58
 
46
59
  - Apache 2.0, ([LICENSE-APACHE](LICENSE-APACHE) / <http://www.apache.org/licenses/LICENSE-2.0>)
47
60
  - MIT ([LICENSE-MIT](LICENSE-MIT) / <http://opensource.org/licenses/MIT>)
48
61
 
49
- ## Contribute
62
+ # Contribute
50
63
 
51
- Contributions welcome! Please check out [the issues](https://github.com/ipfs/helia-strings/issues).
64
+ Contributions welcome! Please check out [the issues](https://github.com/ipfs/helia/issues).
52
65
 
53
66
  Also see our [contributing document](https://github.com/ipfs/community/blob/master/CONTRIBUTING_JS.md) for more information on how we work, and about contributing in general.
54
67
 
package/dist/index.min.js CHANGED
@@ -1,3 +1,3 @@
1
1
  (function (root, factory) {(typeof module === 'object' && module.exports) ? module.exports = factory() : root.HeliaStrings = factory()}(typeof self !== 'undefined' ? self : this, function () {
2
- "use strict";var HeliaStrings=(()=>{var X=Object.defineProperty;var je=Object.getOwnPropertyDescriptor;var qe=Object.getOwnPropertyNames;var Re=Object.prototype.hasOwnProperty;var p=(t,e)=>{for(var r in e)X(t,r,{get:e[r],enumerable:!0})},Je=(t,e,r,o)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of qe(e))!Re.call(t,n)&&n!==r&&X(t,n,{get:()=>e[n],enumerable:!(o=je(e,n))||o.enumerable});return t};var Xe=t=>Je(X({},"__esModule",{value:!0}),t);var or={};p(or,{strings:()=>rr});var W={};p(W,{base32:()=>I,base32hex:()=>et,base32hexpad:()=>rt,base32hexpadupper:()=>ot,base32hexupper:()=>tt,base32pad:()=>Ye,base32padupper:()=>_e,base32upper:()=>Ze,base32z:()=>nt});function Qe(t,e){if(t.length>=255)throw new TypeError("Alphabet too long");for(var r=new Uint8Array(256),o=0;o<r.length;o++)r[o]=255;for(var n=0;n<t.length;n++){var s=t.charAt(n),i=s.charCodeAt(0);if(r[i]!==255)throw new TypeError(s+" is ambiguous");r[i]=n}var c=t.length,d=t.charAt(0),D=Math.log(c)/Math.log(256),u=Math.log(256)/Math.log(c);function T(a){if(a instanceof Uint8Array||(ArrayBuffer.isView(a)?a=new Uint8Array(a.buffer,a.byteOffset,a.byteLength):Array.isArray(a)&&(a=Uint8Array.from(a))),!(a instanceof Uint8Array))throw new TypeError("Expected Uint8Array");if(a.length===0)return"";for(var h=0,E=0,m=0,w=a.length;m!==w&&a[m]===0;)m++,h++;for(var g=(w-m)*u+1>>>0,l=new Uint8Array(g);m!==w;){for(var y=a[m],C=0,b=g-1;(y!==0||C<E)&&b!==-1;b--,C++)y+=256*l[b]>>>0,l[b]=y%c>>>0,y=y/c>>>0;if(y!==0)throw new Error("Non-zero carry");E=C,m++}for(var A=g-E;A!==g&&l[A]===0;)A++;for(var $=d.repeat(h);A<g;++A)$+=t.charAt(l[A]);return $}function F(a){if(typeof a!="string")throw new TypeError("Expected String");if(a.length===0)return new Uint8Array;var h=0;if(a[h]!==" "){for(var E=0,m=0;a[h]===d;)E++,h++;for(var w=(a.length-h)*D+1>>>0,g=new Uint8Array(w);a[h];){var l=r[a.charCodeAt(h)];if(l===255)return;for(var y=0,C=w-1;(l!==0||y<m)&&C!==-1;C--,y++)l+=c*g[C]>>>0,g[C]=l%256>>>0,l=l/256>>>0;if(l!==0)throw new Error("Non-zero carry");m=y,h++}if(a[h]!==" "){for(var b=w-m;b!==w&&g[b]===0;)b++;for(var A=new Uint8Array(E+(w-b)),$=E;b!==w;)A[$++]=g[b++];return A}}}function $e(a){var h=F(a);if(h)return h;throw new Error(`Non-${e} character`)}return{encode:T,decodeUnsafe:F,decode:$e}}var Ge=Qe,Ke=Ge,be=Ke;var ir=new Uint8Array(0);var xe=(t,e)=>{if(t===e)return!0;if(t.byteLength!==e.byteLength)return!1;for(let r=0;r<t.byteLength;r++)if(t[r]!==e[r])return!1;return!0},x=t=>{if(t instanceof Uint8Array&&t.constructor.name==="Uint8Array")return t;if(t instanceof ArrayBuffer)return new Uint8Array(t);if(ArrayBuffer.isView(t))return new Uint8Array(t.buffer,t.byteOffset,t.byteLength);throw new Error("Unknown type, must be binary type")};var we=t=>new TextEncoder().encode(t),ge=t=>new TextDecoder().decode(t);var Q=class{constructor(e,r,o){this.name=e,this.prefix=r,this.baseEncode=o}encode(e){if(e instanceof Uint8Array)return`${this.prefix}${this.baseEncode(e)}`;throw Error("Unknown type, must be binary type")}},G=class{constructor(e,r,o){if(this.name=e,this.prefix=r,r.codePointAt(0)===void 0)throw new Error("Invalid prefix character");this.prefixCodePoint=r.codePointAt(0),this.baseDecode=o}decode(e){if(typeof e=="string"){if(e.codePointAt(0)!==this.prefixCodePoint)throw Error(`Unable to decode multibase string ${JSON.stringify(e)}, ${this.name} decoder only supports inputs prefixed with ${this.prefix}`);return this.baseDecode(e.slice(this.prefix.length))}else throw Error("Can only multibase decode strings")}or(e){return ve(this,e)}},K=class{constructor(e){this.decoders=e}or(e){return ve(this,e)}decode(e){let r=e[0],o=this.decoders[r];if(o)return o.decode(e);throw RangeError(`Unable to decode multibase string ${JSON.stringify(e)}, only inputs prefixed with ${Object.keys(this.decoders)} are supported`)}},ve=(t,e)=>new K({...t.decoders||{[t.prefix]:t},...e.decoders||{[e.prefix]:e}}),H=class{constructor(e,r,o,n){this.name=e,this.prefix=r,this.baseEncode=o,this.baseDecode=n,this.encoder=new Q(e,r,o),this.decoder=new G(e,r,n)}encode(e){return this.encoder.encode(e)}decode(e){return this.decoder.decode(e)}},B=({name:t,prefix:e,encode:r,decode:o})=>new H(t,e,r,o),S=({prefix:t,name:e,alphabet:r})=>{let{encode:o,decode:n}=be(r,e);return B({prefix:t,name:e,encode:o,decode:s=>x(n(s))})},He=(t,e,r,o)=>{let n={};for(let u=0;u<e.length;++u)n[e[u]]=u;let s=t.length;for(;t[s-1]==="=";)--s;let i=new Uint8Array(s*r/8|0),c=0,d=0,D=0;for(let u=0;u<s;++u){let T=n[t[u]];if(T===void 0)throw new SyntaxError(`Non-${o} character`);d=d<<r|T,c+=r,c>=8&&(c-=8,i[D++]=255&d>>c)}if(c>=r||255&d<<8-c)throw new SyntaxError("Unexpected end of data");return i},We=(t,e,r)=>{let o=e[e.length-1]==="=",n=(1<<r)-1,s="",i=0,c=0;for(let d=0;d<t.length;++d)for(c=c<<8|t[d],i+=8;i>r;)i-=r,s+=e[n&c>>i];if(i&&(s+=e[n&c<<r-i]),o)for(;s.length*r&7;)s+="=";return s},f=({name:t,prefix:e,bitsPerChar:r,alphabet:o})=>B({prefix:e,name:t,encode(n){return We(n,o,r)},decode(n){return He(n,o,r,t)}});var I=f({prefix:"b",name:"base32",alphabet:"abcdefghijklmnopqrstuvwxyz234567",bitsPerChar:5}),Ze=f({prefix:"B",name:"base32upper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567",bitsPerChar:5}),Ye=f({prefix:"c",name:"base32pad",alphabet:"abcdefghijklmnopqrstuvwxyz234567=",bitsPerChar:5}),_e=f({prefix:"C",name:"base32padupper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567=",bitsPerChar:5}),et=f({prefix:"v",name:"base32hex",alphabet:"0123456789abcdefghijklmnopqrstuv",bitsPerChar:5}),tt=f({prefix:"V",name:"base32hexupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV",bitsPerChar:5}),rt=f({prefix:"t",name:"base32hexpad",alphabet:"0123456789abcdefghijklmnopqrstuv=",bitsPerChar:5}),ot=f({prefix:"T",name:"base32hexpadupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV=",bitsPerChar:5}),nt=f({prefix:"h",name:"base32z",alphabet:"ybndrfg8ejkmcpqxot1uwisza345h769",bitsPerChar:5});var Z={};p(Z,{base58btc:()=>v,base58flickr:()=>st});var v=S({name:"base58btc",prefix:"z",alphabet:"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"}),st=S({name:"base58flickr",prefix:"Z",alphabet:"123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"});var it=Se,Ae=128,at=127,ct=~at,ft=Math.pow(2,31);function Se(t,e,r){e=e||[],r=r||0;for(var o=r;t>=ft;)e[r++]=t&255|Ae,t/=128;for(;t&ct;)e[r++]=t&255|Ae,t>>>=7;return e[r]=t|0,Se.bytes=r-o+1,e}var dt=Y,ht=128,Ce=127;function Y(t,o){var r=0,o=o||0,n=0,s=o,i,c=t.length;do{if(s>=c)throw Y.bytes=0,new RangeError("Could not decode varint");i=t[s++],r+=n<28?(i&Ce)<<n:(i&Ce)*Math.pow(2,n),n+=7}while(i>=ht);return Y.bytes=s-o,r}var pt=Math.pow(2,7),ut=Math.pow(2,14),lt=Math.pow(2,21),mt=Math.pow(2,28),bt=Math.pow(2,35),xt=Math.pow(2,42),wt=Math.pow(2,49),gt=Math.pow(2,56),yt=Math.pow(2,63),vt=function(t){return t<pt?1:t<ut?2:t<lt?3:t<mt?4:t<bt?5:t<xt?6:t<wt?7:t<gt?8:t<yt?9:10},At={encode:it,decode:dt,encodingLength:vt},Ct=At,L=Ct;var V=(t,e=0)=>[L.decode(t,e),L.decode.bytes],z=(t,e,r=0)=>(L.encode(t,e,r),e),O=t=>L.encodingLength(t);var U=(t,e)=>{let r=e.byteLength,o=O(t),n=o+O(r),s=new Uint8Array(n+r);return z(t,s,0),z(r,s,o),s.set(e,n),new M(t,r,e,s)},Ee=t=>{let e=x(t),[r,o]=V(e),[n,s]=V(e.subarray(o)),i=e.subarray(o+s);if(i.byteLength!==n)throw new Error("Incorrect length");return new M(r,n,i,e)},Ue=(t,e)=>{if(t===e)return!0;{let r=e;return t.code===r.code&&t.size===r.size&&r.bytes instanceof Uint8Array&&xe(t.bytes,r.bytes)}},M=class{constructor(e,r,o,n){this.code=e,this.size=r,this.digest=o,this.bytes=n}};var De=(t,e)=>{let{bytes:r,version:o}=t;switch(o){case 0:return Et(r,_(t),e||v.encoder);default:return Ut(r,_(t),e||I.encoder)}};var Te=new WeakMap,_=t=>{let e=Te.get(t);if(e==null){let r=new Map;return Te.set(t,r),r}return e},N=class t{constructor(e,r,o,n){this.code=r,this.version=e,this.multihash=o,this.bytes=n,this["/"]=n}get asCID(){return this}get byteOffset(){return this.bytes.byteOffset}get byteLength(){return this.bytes.byteLength}toV0(){switch(this.version){case 0:return this;case 1:{let{code:e,multihash:r}=this;if(e!==k)throw new Error("Cannot convert a non dag-pb CID to CIDv0");if(r.code!==Dt)throw new Error("Cannot convert non sha2-256 multihash CID to CIDv0");return t.createV0(r)}default:throw Error(`Can not convert CID version ${this.version} to version 0. This is a bug please report`)}}toV1(){switch(this.version){case 0:{let{code:e,digest:r}=this.multihash,o=U(e,r);return t.createV1(this.code,o)}case 1:return this;default:throw Error(`Can not convert CID version ${this.version} to version 1. This is a bug please report`)}}equals(e){return t.equals(this,e)}static equals(e,r){let o=r;return o&&e.code===o.code&&e.version===o.version&&Ue(e.multihash,o.multihash)}toString(e){return De(this,e)}toJSON(){return{"/":De(this)}}link(){return this}get[Symbol.toStringTag](){return"CID"}[Symbol.for("nodejs.util.inspect.custom")](){return`CID(${this.toString()})`}static asCID(e){if(e==null)return null;let r=e;if(r instanceof t)return r;if(r["/"]!=null&&r["/"]===r.bytes||r.asCID===r){let{version:o,code:n,multihash:s,bytes:i}=r;return new t(o,n,s,i||Be(o,n,s.bytes))}else if(r[Tt]===!0){let{version:o,multihash:n,code:s}=r,i=Ee(n);return t.create(o,s,i)}else return null}static create(e,r,o){if(typeof r!="number")throw new Error("String codecs are no longer supported");if(!(o.bytes instanceof Uint8Array))throw new Error("Invalid digest");switch(e){case 0:{if(r!==k)throw new Error(`Version 0 CID must use dag-pb (code: ${k}) block encoding`);return new t(e,r,o,o.bytes)}case 1:{let n=Be(e,r,o.bytes);return new t(e,r,o,n)}default:throw new Error("Invalid version")}}static createV0(e){return t.create(0,k,e)}static createV1(e,r){return t.create(1,e,r)}static decode(e){let[r,o]=t.decodeFirst(e);if(o.length)throw new Error("Incorrect length");return r}static decodeFirst(e){let r=t.inspectBytes(e),o=r.size-r.multihashSize,n=x(e.subarray(o,o+r.multihashSize));if(n.byteLength!==r.multihashSize)throw new Error("Incorrect length");let s=n.subarray(r.multihashSize-r.digestSize),i=new M(r.multihashCode,r.digestSize,s,n);return[r.version===0?t.createV0(i):t.createV1(r.codec,i),e.subarray(r.size)]}static inspectBytes(e){let r=0,o=()=>{let[T,F]=V(e.subarray(r));return r+=F,T},n=o(),s=k;if(n===18?(n=0,r=0):s=o(),n!==0&&n!==1)throw new RangeError(`Invalid CID version ${n}`);let i=r,c=o(),d=o(),D=r+d,u=D-i;return{version:n,codec:s,multihashCode:c,digestSize:d,multihashSize:u,size:D}}static parse(e,r){let[o,n]=St(e,r),s=t.decode(n);if(s.version===0&&e[0]!=="Q")throw Error("Version 0 CID string must not include multibase prefix");return _(s).set(o,e),s}},St=(t,e)=>{switch(t[0]){case"Q":{let r=e||v;return[v.prefix,r.decode(`${v.prefix}${t}`)]}case v.prefix:{let r=e||v;return[v.prefix,r.decode(t)]}case I.prefix:{let r=e||I;return[I.prefix,r.decode(t)]}default:{if(e==null)throw Error("To parse non base32 or base58btc encoded CID multibase decoder must be provided");return[t[0],e.decode(t)]}}},Et=(t,e,r)=>{let{prefix:o}=r;if(o!==v.prefix)throw Error(`Cannot string encode V0 in ${r.name} encoding`);let n=e.get(o);if(n==null){let s=r.encode(t).slice(1);return e.set(o,s),s}else return n},Ut=(t,e,r)=>{let{prefix:o}=r,n=e.get(o);if(n==null){let s=r.encode(t);return e.set(o,s),s}else return n},k=112,Dt=18,Be=(t,e,r)=>{let o=O(t),n=o+O(e),s=new Uint8Array(n+r.byteLength);return z(t,s,0),z(e,s,o),s.set(r,n),s},Tt=Symbol.for("@ipld/js-cid/CID");var q={};p(q,{code:()=>It,decode:()=>Ot,encode:()=>zt,name:()=>Bt});var Bt="raw",It=85,zt=t=>x(t),Ot=t=>x(t);var oe={};p(oe,{sha256:()=>re,sha512:()=>Mt});var te=({name:t,code:e,encode:r})=>new ee(t,e,r),ee=class{constructor(e,r,o){this.name=e,this.code=r,this.encode=o}digest(e){if(e instanceof Uint8Array){let r=this.encode(e);return r instanceof Uint8Array?U(this.code,r):r.then(o=>U(this.code,o))}else throw Error("Unknown type, must be binary type")}};var ze=t=>async e=>new Uint8Array(await crypto.subtle.digest(t,e)),re=te({name:"sha2-256",code:18,encode:ze("SHA-256")}),Mt=te({name:"sha2-512",code:19,encode:ze("SHA-512")});function R(t){return globalThis.Buffer!=null?new Uint8Array(t.buffer,t.byteOffset,t.byteLength):t}var ne={};p(ne,{base10:()=>Nt});var Nt=S({prefix:"9",name:"base10",alphabet:"0123456789"});var se={};p(se,{base16:()=>Lt,base16upper:()=>Vt});var Lt=f({prefix:"f",name:"base16",alphabet:"0123456789abcdef",bitsPerChar:4}),Vt=f({prefix:"F",name:"base16upper",alphabet:"0123456789ABCDEF",bitsPerChar:4});var ie={};p(ie,{base2:()=>Pt});var Pt=f({prefix:"0",name:"base2",alphabet:"01",bitsPerChar:1});var ae={};p(ae,{base256emoji:()=>qt});var Oe=Array.from("\u{1F680}\u{1FA90}\u2604\u{1F6F0}\u{1F30C}\u{1F311}\u{1F312}\u{1F313}\u{1F314}\u{1F315}\u{1F316}\u{1F317}\u{1F318}\u{1F30D}\u{1F30F}\u{1F30E}\u{1F409}\u2600\u{1F4BB}\u{1F5A5}\u{1F4BE}\u{1F4BF}\u{1F602}\u2764\u{1F60D}\u{1F923}\u{1F60A}\u{1F64F}\u{1F495}\u{1F62D}\u{1F618}\u{1F44D}\u{1F605}\u{1F44F}\u{1F601}\u{1F525}\u{1F970}\u{1F494}\u{1F496}\u{1F499}\u{1F622}\u{1F914}\u{1F606}\u{1F644}\u{1F4AA}\u{1F609}\u263A\u{1F44C}\u{1F917}\u{1F49C}\u{1F614}\u{1F60E}\u{1F607}\u{1F339}\u{1F926}\u{1F389}\u{1F49E}\u270C\u2728\u{1F937}\u{1F631}\u{1F60C}\u{1F338}\u{1F64C}\u{1F60B}\u{1F497}\u{1F49A}\u{1F60F}\u{1F49B}\u{1F642}\u{1F493}\u{1F929}\u{1F604}\u{1F600}\u{1F5A4}\u{1F603}\u{1F4AF}\u{1F648}\u{1F447}\u{1F3B6}\u{1F612}\u{1F92D}\u2763\u{1F61C}\u{1F48B}\u{1F440}\u{1F62A}\u{1F611}\u{1F4A5}\u{1F64B}\u{1F61E}\u{1F629}\u{1F621}\u{1F92A}\u{1F44A}\u{1F973}\u{1F625}\u{1F924}\u{1F449}\u{1F483}\u{1F633}\u270B\u{1F61A}\u{1F61D}\u{1F634}\u{1F31F}\u{1F62C}\u{1F643}\u{1F340}\u{1F337}\u{1F63B}\u{1F613}\u2B50\u2705\u{1F97A}\u{1F308}\u{1F608}\u{1F918}\u{1F4A6}\u2714\u{1F623}\u{1F3C3}\u{1F490}\u2639\u{1F38A}\u{1F498}\u{1F620}\u261D\u{1F615}\u{1F33A}\u{1F382}\u{1F33B}\u{1F610}\u{1F595}\u{1F49D}\u{1F64A}\u{1F639}\u{1F5E3}\u{1F4AB}\u{1F480}\u{1F451}\u{1F3B5}\u{1F91E}\u{1F61B}\u{1F534}\u{1F624}\u{1F33C}\u{1F62B}\u26BD\u{1F919}\u2615\u{1F3C6}\u{1F92B}\u{1F448}\u{1F62E}\u{1F646}\u{1F37B}\u{1F343}\u{1F436}\u{1F481}\u{1F632}\u{1F33F}\u{1F9E1}\u{1F381}\u26A1\u{1F31E}\u{1F388}\u274C\u270A\u{1F44B}\u{1F630}\u{1F928}\u{1F636}\u{1F91D}\u{1F6B6}\u{1F4B0}\u{1F353}\u{1F4A2}\u{1F91F}\u{1F641}\u{1F6A8}\u{1F4A8}\u{1F92C}\u2708\u{1F380}\u{1F37A}\u{1F913}\u{1F619}\u{1F49F}\u{1F331}\u{1F616}\u{1F476}\u{1F974}\u25B6\u27A1\u2753\u{1F48E}\u{1F4B8}\u2B07\u{1F628}\u{1F31A}\u{1F98B}\u{1F637}\u{1F57A}\u26A0\u{1F645}\u{1F61F}\u{1F635}\u{1F44E}\u{1F932}\u{1F920}\u{1F927}\u{1F4CC}\u{1F535}\u{1F485}\u{1F9D0}\u{1F43E}\u{1F352}\u{1F617}\u{1F911}\u{1F30A}\u{1F92F}\u{1F437}\u260E\u{1F4A7}\u{1F62F}\u{1F486}\u{1F446}\u{1F3A4}\u{1F647}\u{1F351}\u2744\u{1F334}\u{1F4A3}\u{1F438}\u{1F48C}\u{1F4CD}\u{1F940}\u{1F922}\u{1F445}\u{1F4A1}\u{1F4A9}\u{1F450}\u{1F4F8}\u{1F47B}\u{1F910}\u{1F92E}\u{1F3BC}\u{1F975}\u{1F6A9}\u{1F34E}\u{1F34A}\u{1F47C}\u{1F48D}\u{1F4E3}\u{1F942}"),kt=Oe.reduce((t,e,r)=>(t[r]=e,t),[]),Ft=Oe.reduce((t,e,r)=>(t[e.codePointAt(0)]=r,t),[]);function $t(t){return t.reduce((e,r)=>(e+=kt[r],e),"")}function jt(t){let e=[];for(let r of t){let o=Ft[r.codePointAt(0)];if(o===void 0)throw new Error(`Non-base256emoji character: ${r}`);e.push(o)}return new Uint8Array(e)}var qt=B({prefix:"\u{1F680}",name:"base256emoji",encode:$t,decode:jt});var ce={};p(ce,{base36:()=>Rt,base36upper:()=>Jt});var Rt=S({prefix:"k",name:"base36",alphabet:"0123456789abcdefghijklmnopqrstuvwxyz"}),Jt=S({prefix:"K",name:"base36upper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"});var fe={};p(fe,{base64:()=>Xt,base64pad:()=>Qt,base64url:()=>Gt,base64urlpad:()=>Kt});var Xt=f({prefix:"m",name:"base64",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",bitsPerChar:6}),Qt=f({prefix:"M",name:"base64pad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",bitsPerChar:6}),Gt=f({prefix:"u",name:"base64url",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_",bitsPerChar:6}),Kt=f({prefix:"U",name:"base64urlpad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_=",bitsPerChar:6});var de={};p(de,{base8:()=>Ht});var Ht=f({prefix:"7",name:"base8",alphabet:"01234567",bitsPerChar:3});var he={};p(he,{identity:()=>Wt});var Wt=B({prefix:"\0",name:"identity",encode:t=>ge(t),decode:t=>we(t)});var Or=new TextEncoder,Mr=new TextDecoder;var pe={};p(pe,{identity:()=>er});var Me=0,Yt="identity",Ne=x,_t=t=>U(Me,Ne(t)),er={code:Me,name:Yt,encode:Ne,digest:_t};var ue={...he,...ie,...de,...ne,...se,...W,...ce,...Z,...fe,...ae},Fr={...oe,...pe};function Le(t=0){return globalThis.Buffer?.allocUnsafe!=null?R(globalThis.Buffer.allocUnsafe(t)):new Uint8Array(t)}function Pe(t,e,r,o){return{name:t,prefix:e,encoder:{name:t,prefix:e,encode:r},decoder:{decode:o}}}var Ve=Pe("utf8","u",t=>"u"+new TextDecoder("utf8").decode(t),t=>new TextEncoder().encode(t.substring(1))),le=Pe("ascii","a",t=>{let e="a";for(let r=0;r<t.length;r++)e+=String.fromCharCode(t[r]);return e},t=>{t=t.substring(1);let e=Le(t.length);for(let r=0;r<t.length;r++)e[r]=t.charCodeAt(r);return e}),tr={utf8:Ve,"utf-8":Ve,hex:ue.base16,latin1:le,ascii:le,binary:le,...ue},J=tr;function ke(t,e="utf8"){let r=J[e];if(r==null)throw new Error(`Unsupported encoding "${e}"`);return(e==="utf8"||e==="utf-8")&&globalThis.Buffer!=null&&globalThis.Buffer.from!=null?R(globalThis.Buffer.from(t,"utf-8")):r.decoder.decode(`${r.prefix}${t}`)}function Fe(t,e="utf8"){let r=J[e];if(r==null)throw new Error(`Unsupported encoding "${e}"`);return(e==="utf8"||e==="utf-8")&&globalThis.Buffer!=null&&globalThis.Buffer.from!=null?globalThis.Buffer.from(t.buffer,t.byteOffset,t.byteLength).toString("utf8"):r.encoder.encode(t).substring(1)}var me=class{components;constructor(e){this.components=e}async add(e,r={}){let o=ke(e),n=await(r.hasher??re).digest(o),s=r.codec??q,i=N.createV1(s.code,n);return await this.components.blockstore.put(i,o,r),i}async get(e,r={}){let o=await this.components.blockstore.get(e,r);return Fe(o)}};function rr(t){return new me(t)}return Xe(or);})();
2
+ "use strict";var HeliaStrings=(()=>{var X=Object.defineProperty;var je=Object.getOwnPropertyDescriptor;var qe=Object.getOwnPropertyNames;var Re=Object.prototype.hasOwnProperty;var h=(t,e)=>{for(var r in e)X(t,r,{get:e[r],enumerable:!0})},Je=(t,e,r,o)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of qe(e))!Re.call(t,n)&&n!==r&&X(t,n,{get:()=>e[n],enumerable:!(o=je(e,n))||o.enumerable});return t};var Xe=t=>Je(X({},"__esModule",{value:!0}),t);var or={};h(or,{strings:()=>rr});var W={};h(W,{base32:()=>z,base32hex:()=>et,base32hexpad:()=>rt,base32hexpadupper:()=>ot,base32hexupper:()=>tt,base32pad:()=>Ye,base32padupper:()=>_e,base32upper:()=>Ze,base32z:()=>nt});var sr=new Uint8Array(0);function be(t,e){if(t===e)return!0;if(t.byteLength!==e.byteLength)return!1;for(let r=0;r<t.byteLength;r++)if(t[r]!==e[r])return!1;return!0}function x(t){if(t instanceof Uint8Array&&t.constructor.name==="Uint8Array")return t;if(t instanceof ArrayBuffer)return new Uint8Array(t);if(ArrayBuffer.isView(t))return new Uint8Array(t.buffer,t.byteOffset,t.byteLength);throw new Error("Unknown type, must be binary type")}function xe(t){return new TextEncoder().encode(t)}function we(t){return new TextDecoder().decode(t)}function Qe(t,e){if(t.length>=255)throw new TypeError("Alphabet too long");for(var r=new Uint8Array(256),o=0;o<r.length;o++)r[o]=255;for(var n=0;n<t.length;n++){var s=t.charAt(n),i=s.charCodeAt(0);if(r[i]!==255)throw new TypeError(s+" is ambiguous");r[i]=n}var c=t.length,d=t.charAt(0),D=Math.log(c)/Math.log(256),u=Math.log(256)/Math.log(c);function T(a){if(a instanceof Uint8Array||(ArrayBuffer.isView(a)?a=new Uint8Array(a.buffer,a.byteOffset,a.byteLength):Array.isArray(a)&&(a=Uint8Array.from(a))),!(a instanceof Uint8Array))throw new TypeError("Expected Uint8Array");if(a.length===0)return"";for(var p=0,E=0,m=0,w=a.length;m!==w&&a[m]===0;)m++,p++;for(var g=(w-m)*u+1>>>0,l=new Uint8Array(g);m!==w;){for(var y=a[m],C=0,b=g-1;(y!==0||C<E)&&b!==-1;b--,C++)y+=256*l[b]>>>0,l[b]=y%c>>>0,y=y/c>>>0;if(y!==0)throw new Error("Non-zero carry");E=C,m++}for(var A=g-E;A!==g&&l[A]===0;)A++;for(var $=d.repeat(p);A<g;++A)$+=t.charAt(l[A]);return $}function F(a){if(typeof a!="string")throw new TypeError("Expected String");if(a.length===0)return new Uint8Array;var p=0;if(a[p]!==" "){for(var E=0,m=0;a[p]===d;)E++,p++;for(var w=(a.length-p)*D+1>>>0,g=new Uint8Array(w);a[p];){var l=r[a.charCodeAt(p)];if(l===255)return;for(var y=0,C=w-1;(l!==0||y<m)&&C!==-1;C--,y++)l+=c*g[C]>>>0,g[C]=l%256>>>0,l=l/256>>>0;if(l!==0)throw new Error("Non-zero carry");m=y,p++}if(a[p]!==" "){for(var b=w-m;b!==w&&g[b]===0;)b++;for(var A=new Uint8Array(E+(w-b)),$=E;b!==w;)A[$++]=g[b++];return A}}}function $e(a){var p=F(a);if(p)return p;throw new Error(`Non-${e} character`)}return{encode:T,decodeUnsafe:F,decode:$e}}var Ge=Qe,Ke=Ge,ye=Ke;var Q=class{name;prefix;baseEncode;constructor(e,r,o){this.name=e,this.prefix=r,this.baseEncode=o}encode(e){if(e instanceof Uint8Array)return`${this.prefix}${this.baseEncode(e)}`;throw Error("Unknown type, must be binary type")}},G=class{name;prefix;baseDecode;prefixCodePoint;constructor(e,r,o){if(this.name=e,this.prefix=r,r.codePointAt(0)===void 0)throw new Error("Invalid prefix character");this.prefixCodePoint=r.codePointAt(0),this.baseDecode=o}decode(e){if(typeof e=="string"){if(e.codePointAt(0)!==this.prefixCodePoint)throw Error(`Unable to decode multibase string ${JSON.stringify(e)}, ${this.name} decoder only supports inputs prefixed with ${this.prefix}`);return this.baseDecode(e.slice(this.prefix.length))}else throw Error("Can only multibase decode strings")}or(e){return ve(this,e)}},K=class{decoders;constructor(e){this.decoders=e}or(e){return ve(this,e)}decode(e){let r=e[0],o=this.decoders[r];if(o!=null)return o.decode(e);throw RangeError(`Unable to decode multibase string ${JSON.stringify(e)}, only inputs prefixed with ${Object.keys(this.decoders)} are supported`)}};function ve(t,e){return new K({...t.decoders??{[t.prefix]:t},...e.decoders??{[e.prefix]:e}})}var H=class{name;prefix;baseEncode;baseDecode;encoder;decoder;constructor(e,r,o,n){this.name=e,this.prefix=r,this.baseEncode=o,this.baseDecode=n,this.encoder=new Q(e,r,o),this.decoder=new G(e,r,n)}encode(e){return this.encoder.encode(e)}decode(e){return this.decoder.decode(e)}};function B({name:t,prefix:e,encode:r,decode:o}){return new H(t,e,r,o)}function S({name:t,prefix:e,alphabet:r}){let{encode:o,decode:n}=ye(r,t);return B({prefix:e,name:t,encode:o,decode:s=>x(n(s))})}function He(t,e,r,o){let n={};for(let u=0;u<e.length;++u)n[e[u]]=u;let s=t.length;for(;t[s-1]==="=";)--s;let i=new Uint8Array(s*r/8|0),c=0,d=0,D=0;for(let u=0;u<s;++u){let T=n[t[u]];if(T===void 0)throw new SyntaxError(`Non-${o} character`);d=d<<r|T,c+=r,c>=8&&(c-=8,i[D++]=255&d>>c)}if(c>=r||255&d<<8-c)throw new SyntaxError("Unexpected end of data");return i}function We(t,e,r){let o=e[e.length-1]==="=",n=(1<<r)-1,s="",i=0,c=0;for(let d=0;d<t.length;++d)for(c=c<<8|t[d],i+=8;i>r;)i-=r,s+=e[n&c>>i];if(i!==0&&(s+=e[n&c<<r-i]),o)for(;s.length*r&7;)s+="=";return s}function f({name:t,prefix:e,bitsPerChar:r,alphabet:o}){return B({prefix:e,name:t,encode(n){return We(n,o,r)},decode(n){return He(n,o,r,t)}})}var z=f({prefix:"b",name:"base32",alphabet:"abcdefghijklmnopqrstuvwxyz234567",bitsPerChar:5}),Ze=f({prefix:"B",name:"base32upper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567",bitsPerChar:5}),Ye=f({prefix:"c",name:"base32pad",alphabet:"abcdefghijklmnopqrstuvwxyz234567=",bitsPerChar:5}),_e=f({prefix:"C",name:"base32padupper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567=",bitsPerChar:5}),et=f({prefix:"v",name:"base32hex",alphabet:"0123456789abcdefghijklmnopqrstuv",bitsPerChar:5}),tt=f({prefix:"V",name:"base32hexupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV",bitsPerChar:5}),rt=f({prefix:"t",name:"base32hexpad",alphabet:"0123456789abcdefghijklmnopqrstuv=",bitsPerChar:5}),ot=f({prefix:"T",name:"base32hexpadupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV=",bitsPerChar:5}),nt=f({prefix:"h",name:"base32z",alphabet:"ybndrfg8ejkmcpqxot1uwisza345h769",bitsPerChar:5});var Z={};h(Z,{base58btc:()=>v,base58flickr:()=>st});var v=S({name:"base58btc",prefix:"z",alphabet:"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"}),st=S({name:"base58flickr",prefix:"Z",alphabet:"123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"});var it=Se,Ae=128,at=127,ct=~at,ft=Math.pow(2,31);function Se(t,e,r){e=e||[],r=r||0;for(var o=r;t>=ft;)e[r++]=t&255|Ae,t/=128;for(;t&ct;)e[r++]=t&255|Ae,t>>>=7;return e[r]=t|0,Se.bytes=r-o+1,e}var dt=Y,pt=128,Ce=127;function Y(t,o){var r=0,o=o||0,n=0,s=o,i,c=t.length;do{if(s>=c)throw Y.bytes=0,new RangeError("Could not decode varint");i=t[s++],r+=n<28?(i&Ce)<<n:(i&Ce)*Math.pow(2,n),n+=7}while(i>=pt);return Y.bytes=s-o,r}var ht=Math.pow(2,7),ut=Math.pow(2,14),lt=Math.pow(2,21),mt=Math.pow(2,28),bt=Math.pow(2,35),xt=Math.pow(2,42),wt=Math.pow(2,49),gt=Math.pow(2,56),yt=Math.pow(2,63),vt=function(t){return t<ht?1:t<ut?2:t<lt?3:t<mt?4:t<bt?5:t<xt?6:t<wt?7:t<gt?8:t<yt?9:10},At={encode:it,decode:dt,encodingLength:vt},Ct=At,L=Ct;function V(t,e=0){return[L.decode(t,e),L.decode.bytes]}function I(t,e,r=0){return L.encode(t,e,r),e}function O(t){return L.encodingLength(t)}function U(t,e){let r=e.byteLength,o=O(t),n=o+O(r),s=new Uint8Array(n+r);return I(t,s,0),I(r,s,o),s.set(e,n),new M(t,r,e,s)}function Ee(t){let e=x(t),[r,o]=V(e),[n,s]=V(e.subarray(o)),i=e.subarray(o+s);if(i.byteLength!==n)throw new Error("Incorrect length");return new M(r,n,i,e)}function Ue(t,e){if(t===e)return!0;{let r=e;return t.code===r.code&&t.size===r.size&&r.bytes instanceof Uint8Array&&be(t.bytes,r.bytes)}}var M=class{code;size;digest;bytes;constructor(e,r,o,n){this.code=e,this.size=r,this.digest=o,this.bytes=n}};function De(t,e){let{bytes:r,version:o}=t;switch(o){case 0:return Et(r,_(t),e??v.encoder);default:return Ut(r,_(t),e??z.encoder)}}var Te=new WeakMap;function _(t){let e=Te.get(t);if(e==null){let r=new Map;return Te.set(t,r),r}return e}var N=class t{code;version;multihash;bytes;"/";constructor(e,r,o,n){this.code=r,this.version=e,this.multihash=o,this.bytes=n,this["/"]=n}get asCID(){return this}get byteOffset(){return this.bytes.byteOffset}get byteLength(){return this.bytes.byteLength}toV0(){switch(this.version){case 0:return this;case 1:{let{code:e,multihash:r}=this;if(e!==k)throw new Error("Cannot convert a non dag-pb CID to CIDv0");if(r.code!==Dt)throw new Error("Cannot convert non sha2-256 multihash CID to CIDv0");return t.createV0(r)}default:throw Error(`Can not convert CID version ${this.version} to version 0. This is a bug please report`)}}toV1(){switch(this.version){case 0:{let{code:e,digest:r}=this.multihash,o=U(e,r);return t.createV1(this.code,o)}case 1:return this;default:throw Error(`Can not convert CID version ${this.version} to version 1. This is a bug please report`)}}equals(e){return t.equals(this,e)}static equals(e,r){let o=r;return o!=null&&e.code===o.code&&e.version===o.version&&Ue(e.multihash,o.multihash)}toString(e){return De(this,e)}toJSON(){return{"/":De(this)}}link(){return this}[Symbol.toStringTag]="CID";[Symbol.for("nodejs.util.inspect.custom")](){return`CID(${this.toString()})`}static asCID(e){if(e==null)return null;let r=e;if(r instanceof t)return r;if(r["/"]!=null&&r["/"]===r.bytes||r.asCID===r){let{version:o,code:n,multihash:s,bytes:i}=r;return new t(o,n,s,i??Be(o,n,s.bytes))}else if(r[Tt]===!0){let{version:o,multihash:n,code:s}=r,i=Ee(n);return t.create(o,s,i)}else return null}static create(e,r,o){if(typeof r!="number")throw new Error("String codecs are no longer supported");if(!(o.bytes instanceof Uint8Array))throw new Error("Invalid digest");switch(e){case 0:{if(r!==k)throw new Error(`Version 0 CID must use dag-pb (code: ${k}) block encoding`);return new t(e,r,o,o.bytes)}case 1:{let n=Be(e,r,o.bytes);return new t(e,r,o,n)}default:throw new Error("Invalid version")}}static createV0(e){return t.create(0,k,e)}static createV1(e,r){return t.create(1,e,r)}static decode(e){let[r,o]=t.decodeFirst(e);if(o.length!==0)throw new Error("Incorrect length");return r}static decodeFirst(e){let r=t.inspectBytes(e),o=r.size-r.multihashSize,n=x(e.subarray(o,o+r.multihashSize));if(n.byteLength!==r.multihashSize)throw new Error("Incorrect length");let s=n.subarray(r.multihashSize-r.digestSize),i=new M(r.multihashCode,r.digestSize,s,n);return[r.version===0?t.createV0(i):t.createV1(r.codec,i),e.subarray(r.size)]}static inspectBytes(e){let r=0,o=()=>{let[T,F]=V(e.subarray(r));return r+=F,T},n=o(),s=k;if(n===18?(n=0,r=0):s=o(),n!==0&&n!==1)throw new RangeError(`Invalid CID version ${n}`);let i=r,c=o(),d=o(),D=r+d,u=D-i;return{version:n,codec:s,multihashCode:c,digestSize:d,multihashSize:u,size:D}}static parse(e,r){let[o,n]=St(e,r),s=t.decode(n);if(s.version===0&&e[0]!=="Q")throw Error("Version 0 CID string must not include multibase prefix");return _(s).set(o,e),s}};function St(t,e){switch(t[0]){case"Q":{let r=e??v;return[v.prefix,r.decode(`${v.prefix}${t}`)]}case v.prefix:{let r=e??v;return[v.prefix,r.decode(t)]}case z.prefix:{let r=e??z;return[z.prefix,r.decode(t)]}default:{if(e==null)throw Error("To parse non base32 or base58btc encoded CID multibase decoder must be provided");return[t[0],e.decode(t)]}}}function Et(t,e,r){let{prefix:o}=r;if(o!==v.prefix)throw Error(`Cannot string encode V0 in ${r.name} encoding`);let n=e.get(o);if(n==null){let s=r.encode(t).slice(1);return e.set(o,s),s}else return n}function Ut(t,e,r){let{prefix:o}=r,n=e.get(o);if(n==null){let s=r.encode(t);return e.set(o,s),s}else return n}var k=112,Dt=18;function Be(t,e,r){let o=O(t),n=o+O(e),s=new Uint8Array(n+r.byteLength);return I(t,s,0),I(e,s,o),s.set(r,n),s}var Tt=Symbol.for("@ipld/js-cid/CID");var q={};h(q,{code:()=>zt,decode:()=>Ot,encode:()=>It,name:()=>Bt});var Bt="raw",zt=85;function It(t){return x(t)}function Ot(t){return x(t)}var oe={};h(oe,{sha256:()=>re,sha512:()=>Mt});function te({name:t,code:e,encode:r}){return new ee(t,e,r)}var ee=class{name;code;encode;constructor(e,r,o){this.name=e,this.code=r,this.encode=o}digest(e){if(e instanceof Uint8Array){let r=this.encode(e);return r instanceof Uint8Array?U(this.code,r):r.then(o=>U(this.code,o))}else throw Error("Unknown type, must be binary type")}};function Ie(t){return async e=>new Uint8Array(await crypto.subtle.digest(t,e))}var re=te({name:"sha2-256",code:18,encode:Ie("SHA-256")}),Mt=te({name:"sha2-512",code:19,encode:Ie("SHA-512")});function R(t){return globalThis.Buffer!=null?new Uint8Array(t.buffer,t.byteOffset,t.byteLength):t}var ne={};h(ne,{base10:()=>Nt});var Nt=S({prefix:"9",name:"base10",alphabet:"0123456789"});var se={};h(se,{base16:()=>Lt,base16upper:()=>Vt});var Lt=f({prefix:"f",name:"base16",alphabet:"0123456789abcdef",bitsPerChar:4}),Vt=f({prefix:"F",name:"base16upper",alphabet:"0123456789ABCDEF",bitsPerChar:4});var ie={};h(ie,{base2:()=>Pt});var Pt=f({prefix:"0",name:"base2",alphabet:"01",bitsPerChar:1});var ae={};h(ae,{base256emoji:()=>qt});var Oe=Array.from("\u{1F680}\u{1FA90}\u2604\u{1F6F0}\u{1F30C}\u{1F311}\u{1F312}\u{1F313}\u{1F314}\u{1F315}\u{1F316}\u{1F317}\u{1F318}\u{1F30D}\u{1F30F}\u{1F30E}\u{1F409}\u2600\u{1F4BB}\u{1F5A5}\u{1F4BE}\u{1F4BF}\u{1F602}\u2764\u{1F60D}\u{1F923}\u{1F60A}\u{1F64F}\u{1F495}\u{1F62D}\u{1F618}\u{1F44D}\u{1F605}\u{1F44F}\u{1F601}\u{1F525}\u{1F970}\u{1F494}\u{1F496}\u{1F499}\u{1F622}\u{1F914}\u{1F606}\u{1F644}\u{1F4AA}\u{1F609}\u263A\u{1F44C}\u{1F917}\u{1F49C}\u{1F614}\u{1F60E}\u{1F607}\u{1F339}\u{1F926}\u{1F389}\u{1F49E}\u270C\u2728\u{1F937}\u{1F631}\u{1F60C}\u{1F338}\u{1F64C}\u{1F60B}\u{1F497}\u{1F49A}\u{1F60F}\u{1F49B}\u{1F642}\u{1F493}\u{1F929}\u{1F604}\u{1F600}\u{1F5A4}\u{1F603}\u{1F4AF}\u{1F648}\u{1F447}\u{1F3B6}\u{1F612}\u{1F92D}\u2763\u{1F61C}\u{1F48B}\u{1F440}\u{1F62A}\u{1F611}\u{1F4A5}\u{1F64B}\u{1F61E}\u{1F629}\u{1F621}\u{1F92A}\u{1F44A}\u{1F973}\u{1F625}\u{1F924}\u{1F449}\u{1F483}\u{1F633}\u270B\u{1F61A}\u{1F61D}\u{1F634}\u{1F31F}\u{1F62C}\u{1F643}\u{1F340}\u{1F337}\u{1F63B}\u{1F613}\u2B50\u2705\u{1F97A}\u{1F308}\u{1F608}\u{1F918}\u{1F4A6}\u2714\u{1F623}\u{1F3C3}\u{1F490}\u2639\u{1F38A}\u{1F498}\u{1F620}\u261D\u{1F615}\u{1F33A}\u{1F382}\u{1F33B}\u{1F610}\u{1F595}\u{1F49D}\u{1F64A}\u{1F639}\u{1F5E3}\u{1F4AB}\u{1F480}\u{1F451}\u{1F3B5}\u{1F91E}\u{1F61B}\u{1F534}\u{1F624}\u{1F33C}\u{1F62B}\u26BD\u{1F919}\u2615\u{1F3C6}\u{1F92B}\u{1F448}\u{1F62E}\u{1F646}\u{1F37B}\u{1F343}\u{1F436}\u{1F481}\u{1F632}\u{1F33F}\u{1F9E1}\u{1F381}\u26A1\u{1F31E}\u{1F388}\u274C\u270A\u{1F44B}\u{1F630}\u{1F928}\u{1F636}\u{1F91D}\u{1F6B6}\u{1F4B0}\u{1F353}\u{1F4A2}\u{1F91F}\u{1F641}\u{1F6A8}\u{1F4A8}\u{1F92C}\u2708\u{1F380}\u{1F37A}\u{1F913}\u{1F619}\u{1F49F}\u{1F331}\u{1F616}\u{1F476}\u{1F974}\u25B6\u27A1\u2753\u{1F48E}\u{1F4B8}\u2B07\u{1F628}\u{1F31A}\u{1F98B}\u{1F637}\u{1F57A}\u26A0\u{1F645}\u{1F61F}\u{1F635}\u{1F44E}\u{1F932}\u{1F920}\u{1F927}\u{1F4CC}\u{1F535}\u{1F485}\u{1F9D0}\u{1F43E}\u{1F352}\u{1F617}\u{1F911}\u{1F30A}\u{1F92F}\u{1F437}\u260E\u{1F4A7}\u{1F62F}\u{1F486}\u{1F446}\u{1F3A4}\u{1F647}\u{1F351}\u2744\u{1F334}\u{1F4A3}\u{1F438}\u{1F48C}\u{1F4CD}\u{1F940}\u{1F922}\u{1F445}\u{1F4A1}\u{1F4A9}\u{1F450}\u{1F4F8}\u{1F47B}\u{1F910}\u{1F92E}\u{1F3BC}\u{1F975}\u{1F6A9}\u{1F34E}\u{1F34A}\u{1F47C}\u{1F48D}\u{1F4E3}\u{1F942}"),kt=Oe.reduce((t,e,r)=>(t[r]=e,t),[]),Ft=Oe.reduce((t,e,r)=>(t[e.codePointAt(0)]=r,t),[]);function $t(t){return t.reduce((e,r)=>(e+=kt[r],e),"")}function jt(t){let e=[];for(let r of t){let o=Ft[r.codePointAt(0)];if(o===void 0)throw new Error(`Non-base256emoji character: ${r}`);e.push(o)}return new Uint8Array(e)}var qt=B({prefix:"\u{1F680}",name:"base256emoji",encode:$t,decode:jt});var ce={};h(ce,{base36:()=>Rt,base36upper:()=>Jt});var Rt=S({prefix:"k",name:"base36",alphabet:"0123456789abcdefghijklmnopqrstuvwxyz"}),Jt=S({prefix:"K",name:"base36upper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"});var fe={};h(fe,{base64:()=>Xt,base64pad:()=>Qt,base64url:()=>Gt,base64urlpad:()=>Kt});var Xt=f({prefix:"m",name:"base64",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",bitsPerChar:6}),Qt=f({prefix:"M",name:"base64pad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",bitsPerChar:6}),Gt=f({prefix:"u",name:"base64url",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_",bitsPerChar:6}),Kt=f({prefix:"U",name:"base64urlpad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_=",bitsPerChar:6});var de={};h(de,{base8:()=>Ht});var Ht=f({prefix:"7",name:"base8",alphabet:"01234567",bitsPerChar:3});var pe={};h(pe,{identity:()=>Wt});var Wt=B({prefix:"\0",name:"identity",encode:t=>we(t),decode:t=>xe(t)});var Or=new TextEncoder,Mr=new TextDecoder;var he={};h(he,{identity:()=>er});var Me=0,Yt="identity",Ne=x;function _t(t){return U(Me,Ne(t))}var er={code:Me,name:Yt,encode:Ne,digest:_t};var ue={...pe,...ie,...de,...ne,...se,...W,...ce,...Z,...fe,...ae},Jr={...oe,...he};function Le(t=0){return globalThis.Buffer?.allocUnsafe!=null?R(globalThis.Buffer.allocUnsafe(t)):new Uint8Array(t)}function Pe(t,e,r,o){return{name:t,prefix:e,encoder:{name:t,prefix:e,encode:r},decoder:{decode:o}}}var Ve=Pe("utf8","u",t=>"u"+new TextDecoder("utf8").decode(t),t=>new TextEncoder().encode(t.substring(1))),le=Pe("ascii","a",t=>{let e="a";for(let r=0;r<t.length;r++)e+=String.fromCharCode(t[r]);return e},t=>{t=t.substring(1);let e=Le(t.length);for(let r=0;r<t.length;r++)e[r]=t.charCodeAt(r);return e}),tr={utf8:Ve,"utf-8":Ve,hex:ue.base16,latin1:le,ascii:le,binary:le,...ue},J=tr;function ke(t,e="utf8"){let r=J[e];if(r==null)throw new Error(`Unsupported encoding "${e}"`);return(e==="utf8"||e==="utf-8")&&globalThis.Buffer!=null&&globalThis.Buffer.from!=null?R(globalThis.Buffer.from(t,"utf-8")):r.decoder.decode(`${r.prefix}${t}`)}function Fe(t,e="utf8"){let r=J[e];if(r==null)throw new Error(`Unsupported encoding "${e}"`);return(e==="utf8"||e==="utf-8")&&globalThis.Buffer!=null&&globalThis.Buffer.from!=null?globalThis.Buffer.from(t.buffer,t.byteOffset,t.byteLength).toString("utf8"):r.encoder.encode(t).substring(1)}var me=class{components;constructor(e){this.components=e}async add(e,r={}){let o=ke(e),n=await(r.hasher??re).digest(o),s=r.codec??q,i=N.createV1(s.code,n);return await this.components.blockstore.put(i,o,r),i}async get(e,r={}){let o=await this.components.blockstore.get(e,r);return Fe(o)}};function rr(t){return new me(t)}return Xe(or);})();
3
3
  return HeliaStrings}));
@@ -3,7 +3,7 @@
3
3
  *
4
4
  * `@helia/strings` makes working with strings {@link https://github.com/ipfs/helia Helia} simple & straightforward.
5
5
  *
6
- * See the {@link Strings Strings interface} for all available operations.
6
+ * See the [API docs](https://ipfs.github.io/helia/modules/_helia_strings.html) for all available operations.
7
7
  *
8
8
  * @example
9
9
  *
package/dist/src/index.js CHANGED
@@ -3,7 +3,7 @@
3
3
  *
4
4
  * `@helia/strings` makes working with strings {@link https://github.com/ipfs/helia Helia} simple & straightforward.
5
5
  *
6
- * See the {@link Strings Strings interface} for all available operations.
6
+ * See the [API docs](https://ipfs.github.io/helia/modules/_helia_strings.html) for all available operations.
7
7
  *
8
8
  * @example
9
9
  *
package/package.json CHANGED
@@ -1,15 +1,19 @@
1
1
  {
2
2
  "name": "@helia/strings",
3
- "version": "1.0.1",
3
+ "version": "2.0.0-3f4c6bf",
4
4
  "description": "Add/get IPLD blocks containing strings with your Helia node",
5
5
  "license": "Apache-2.0 OR MIT",
6
- "homepage": "https://github.com/ipfs/helia-strings/tree/master/packages/strings#readme",
6
+ "homepage": "https://github.com/ipfs/helia/tree/main/packages/strings#readme",
7
7
  "repository": {
8
8
  "type": "git",
9
- "url": "git+https://github.com/ipfs/helia-strings.git"
9
+ "url": "git+https://github.com/ipfs/helia.git"
10
10
  },
11
11
  "bugs": {
12
- "url": "https://github.com/ipfs/helia-strings/issues"
12
+ "url": "https://github.com/ipfs/helia/issues"
13
+ },
14
+ "publishConfig": {
15
+ "access": "public",
16
+ "provenance": true
13
17
  },
14
18
  "keywords": [
15
19
  "IPFS"
@@ -31,8 +35,9 @@
31
35
  "eslintConfig": {
32
36
  "extends": "ipfs",
33
37
  "parserOptions": {
34
- "package": true,
35
- "sourceType": "module"
38
+ "project": true,
39
+ "sourceType": "module",
40
+ "package": true
36
41
  }
37
42
  },
38
43
  "release": {
@@ -136,18 +141,15 @@
136
141
  "release": "aegir release"
137
142
  },
138
143
  "dependencies": {
139
- "@helia/interface": "^2.0.0",
144
+ "@helia/interface": "3.0.0-3f4c6bf",
140
145
  "@libp2p/interfaces": "^3.3.1",
141
- "interface-blockstore": "^5.0.0",
142
- "multiformats": "^12.1.2",
146
+ "multiformats": "^13.0.0",
143
147
  "progress-events": "^1.0.0",
144
- "uint8arrays": "^4.0.3"
148
+ "uint8arrays": "^5.0.1"
145
149
  },
146
150
  "devDependencies": {
147
- "aegir": "^41.0.0",
148
- "blockstore-core": "^4.0.1"
149
- },
150
- "typedoc": {
151
- "entryPoint": "./src/index.ts"
151
+ "aegir": "^42.1.0",
152
+ "blockstore-core": "^4.3.8",
153
+ "interface-blockstore": "^5.2.9"
152
154
  }
153
155
  }
package/src/index.ts CHANGED
@@ -3,7 +3,7 @@
3
3
  *
4
4
  * `@helia/strings` makes working with strings {@link https://github.com/ipfs/helia Helia} simple & straightforward.
5
5
  *
6
- * See the {@link Strings Strings interface} for all available operations.
6
+ * See the [API docs](https://ipfs.github.io/helia/modules/_helia_strings.html) for all available operations.
7
7
  *
8
8
  * @example
9
9
  *
@@ -1,12 +0,0 @@
1
- {
2
- "AddOptions": "https://ipfs.github.io/helia-strings/interfaces/AddOptions.html",
3
- ".:AddOptions": "https://ipfs.github.io/helia-strings/interfaces/AddOptions.html",
4
- "GetOptions": "https://ipfs.github.io/helia-strings/interfaces/GetOptions.html",
5
- ".:GetOptions": "https://ipfs.github.io/helia-strings/interfaces/GetOptions.html",
6
- "Strings": "https://ipfs.github.io/helia-strings/interfaces/Strings.html",
7
- ".:Strings": "https://ipfs.github.io/helia-strings/interfaces/Strings.html",
8
- "StringsComponents": "https://ipfs.github.io/helia-strings/interfaces/StringsComponents.html",
9
- ".:StringsComponents": "https://ipfs.github.io/helia-strings/interfaces/StringsComponents.html",
10
- "strings": "https://ipfs.github.io/helia-strings/functions/strings-1.html",
11
- ".:strings": "https://ipfs.github.io/helia-strings/functions/strings-1.html"
12
- }