@bcts/provenance-mark 1.0.0-beta.4 → 1.0.0-beta.6

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/index.mjs CHANGED
@@ -557,7 +557,8 @@ function obfuscate(key, message) {
557
557
  const extendedKey = extendKey(key instanceof Uint8Array ? key : new Uint8Array(key));
558
558
  const iv = /* @__PURE__ */ new Uint8Array(12);
559
559
  for (let i = 0; i < 12; i++) iv[i] = extendedKey[31 - i];
560
- return chacha20(extendedKey, iv, message instanceof Uint8Array ? message : new Uint8Array(message));
560
+ const messageBytes = message instanceof Uint8Array ? message : new Uint8Array(message);
561
+ return chacha20(extendedKey, iv, messageBytes);
561
562
  }
562
563
  //#endregion
563
564
  //#region src/seed.ts
@@ -1004,9 +1005,7 @@ function formatText(report) {
1004
1005
  case "NonGenesisAtZero":
1005
1006
  issueStr = "non-genesis at seq 0";
1006
1007
  break;
1007
- case "InvalidGenesisKey":
1008
- issueStr = "invalid genesis key";
1009
- break;
1008
+ case "InvalidGenesisKey": issueStr = "invalid genesis key";
1010
1009
  }
1011
1010
  annotations.push(issueStr);
1012
1011
  }
@@ -1589,7 +1588,8 @@ var ProvenanceMark = class ProvenanceMark {
1589
1588
  * Decode from URL encoding.
1590
1589
  */
1591
1590
  static fromUrlEncoding(urlEncoding) {
1592
- const cborValue = decodeCbor(decodeBytewords(urlEncoding, BytewordsStyle.Minimal));
1591
+ const cborData = decodeBytewords(urlEncoding, BytewordsStyle.Minimal);
1592
+ const cborValue = decodeCbor(cborData);
1593
1593
  return ProvenanceMark.fromTaggedCbor(cborValue);
1594
1594
  }
1595
1595
  /**
@@ -2048,7 +2048,10 @@ var ProvenanceMarkInfo = class ProvenanceMarkInfo {
2048
2048
  * and vice versa).
2049
2049
  */
2050
2050
  static new(mark, comment = "") {
2051
- return new ProvenanceMarkInfo(mark, mark.ur(), mark.idBytewords(4, true), mark.idBytemoji(4, true), comment);
2051
+ const ur = mark.ur();
2052
+ const bytewords = mark.idBytewords(4, true);
2053
+ const bytemoji = mark.idBytemoji(4, true);
2054
+ return new ProvenanceMarkInfo(mark, ur, bytewords, bytemoji, comment);
2052
2055
  }
2053
2056
  mark() {
2054
2057
  return this._mark;
@@ -2120,7 +2123,8 @@ var ProvenanceMarkInfo = class ProvenanceMarkInfo {
2120
2123
  const ur = mark.ur();
2121
2124
  const bytewords = json["bytewords"];
2122
2125
  const bytemoji = json["bytemoji"];
2123
- return new ProvenanceMarkInfo(mark, ur, bytewords, bytemoji, typeof json["comment"] === "string" ? json["comment"] : "");
2126
+ const comment = typeof json["comment"] === "string" ? json["comment"] : "";
2127
+ return new ProvenanceMarkInfo(mark, ur, bytewords, bytemoji, comment);
2124
2128
  }
2125
2129
  };
2126
2130
  //#endregion