@atcute/cbor 1.0.2 → 1.0.3

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
@@ -1,8 +1,8 @@
1
1
  # @atcute/cbor
2
2
 
3
- DAG-CBOR codec that deals in AT Protocol's HTTP wire format.
3
+ DAG-CBOR codec library, focused on dealing with AT Protocol's HTTP wire format.
4
4
 
5
- - Only JSON types are recognized and nothing else (sorta), this means:
5
+ - Only JSON types are recognized and almost nothing else, this means:
6
6
  - No `Map` objects, it will always be plain objects with string keys
7
7
  - No `undefined` values, it will be skipped or will throw an error
8
8
  - No tagged value support other than CID, which gets converted to a cid-link interface
package/dist/cid-link.js CHANGED
@@ -1,4 +1,5 @@
1
- import { format, parse, decode } from '@atcute/cid';
1
+ import * as base32 from '@atcute/base32';
2
+ import { decode, parse } from '@atcute/cid';
2
3
  export class CIDLinkWrapper {
3
4
  $bytes;
4
5
  constructor($bytes) {
@@ -8,7 +9,7 @@ export class CIDLinkWrapper {
8
9
  return decode(this.$bytes);
9
10
  }
10
11
  get $link() {
11
- return format(decode(this.$bytes));
12
+ return 'b' + base32.encode(this.$bytes);
12
13
  }
13
14
  toJSON() {
14
15
  return { $link: this.$link };
@@ -1 +1 @@
1
- {"version":3,"file":"cid-link.js","sourceRoot":"","sources":["../lib/cid-link.ts"],"names":[],"mappings":"AAAA,OAAO,EAAY,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAM9D,MAAM,OAAO,cAAc;IACP;IAAnB,YAAmB,MAAkB;QAAlB,WAAM,GAAN,MAAM,CAAY;IAAG,CAAC;IAEzC,IAAI,IAAI;QACP,OAAO,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;IAC5B,CAAC;IAED,IAAI,KAAK;QACR,OAAO,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC;IACpC,CAAC;IAED,MAAM;QACL,OAAO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;IAClC,CAAC;IAED,OAAO,IAAI,cAAc,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;AACxC,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,WAAW,GAAG,CAAC,IAAa,EAAO,EAAE;IACjD,IAAI,IAAI,YAAY,cAAc,EAAE,CAAC;QACpC,OAAO,IAAI,CAAC,IAAI,CAAC;IAClB,CAAC;IAED,OAAO,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;AAC1B,CAAC,CAAC"}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "type": "module",
3
3
  "name": "@atcute/cbor",
4
- "version": "1.0.2",
4
+ "version": "1.0.3",
5
5
  "description": "DAG-CBOR codec that deals in AT Protocol's HTTP wire format",
6
6
  "license": "MIT",
7
7
  "repository": {