@atcute/cid 2.2.1 → 2.2.2
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/dist/cid-link.d.ts +4 -0
- package/dist/cid-link.js +3 -0
- package/dist/cid-link.js.map +1 -1
- package/lib/cid-link.ts +5 -0
- package/package.json +1 -1
package/dist/cid-link.d.ts
CHANGED
|
@@ -1,9 +1,12 @@
|
|
|
1
1
|
import { type Cid } from './codec.js';
|
|
2
|
+
declare const CID_LINK_SYMBOL: unique symbol;
|
|
2
3
|
export interface CidLink {
|
|
3
4
|
$link: string;
|
|
4
5
|
}
|
|
5
6
|
export declare class CidLinkWrapper implements CidLink {
|
|
6
7
|
bytes: Uint8Array;
|
|
8
|
+
/** @internal */
|
|
9
|
+
readonly [CID_LINK_SYMBOL] = true;
|
|
7
10
|
constructor(bytes: Uint8Array);
|
|
8
11
|
get $link(): string;
|
|
9
12
|
toJSON(): CidLink;
|
|
@@ -11,3 +14,4 @@ export declare class CidLinkWrapper implements CidLink {
|
|
|
11
14
|
export declare const isCidLink: (value: unknown) => value is CidLink;
|
|
12
15
|
export declare const toCidLink: (cid: Cid) => CidLink;
|
|
13
16
|
export declare const fromCidLink: (link: CidLink) => Cid;
|
|
17
|
+
export {};
|
package/dist/cid-link.js
CHANGED
|
@@ -1,7 +1,10 @@
|
|
|
1
1
|
import { toBase32 } from '@atcute/multibase';
|
|
2
2
|
import { decode, fromString } from './codec.js';
|
|
3
|
+
const CID_LINK_SYMBOL = Symbol.for('@atcute/cid-link-wrapper');
|
|
3
4
|
export class CidLinkWrapper {
|
|
4
5
|
bytes;
|
|
6
|
+
/** @internal */
|
|
7
|
+
[CID_LINK_SYMBOL] = true;
|
|
5
8
|
constructor(bytes) {
|
|
6
9
|
this.bytes = bytes;
|
|
7
10
|
}
|
package/dist/cid-link.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cid-link.js","sourceRoot":"","sources":["../lib/c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,EAAO,EAAE;IACjD,IAAI,IAAI,YAAY,cAAc,EAAE,CAAC;QACpC,OAAO,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;IAC3B,CAAC;IAED,OAAO,UAAU,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;AAC/B,CAAC,CAAC"}
|
package/lib/cid-link.ts
CHANGED
|
@@ -2,11 +2,16 @@ import { toBase32 } from '@atcute/multibase';
|
|
|
2
2
|
|
|
3
3
|
import { decode, fromString, type Cid } from './codec.js';
|
|
4
4
|
|
|
5
|
+
const CID_LINK_SYMBOL = Symbol.for('@atcute/cid-link-wrapper');
|
|
6
|
+
|
|
5
7
|
export interface CidLink {
|
|
6
8
|
$link: string;
|
|
7
9
|
}
|
|
8
10
|
|
|
9
11
|
export class CidLinkWrapper implements CidLink {
|
|
12
|
+
/** @internal */
|
|
13
|
+
readonly [CID_LINK_SYMBOL] = true;
|
|
14
|
+
|
|
10
15
|
constructor(public bytes: Uint8Array) {}
|
|
11
16
|
|
|
12
17
|
get $link(): string {
|