cafe-utility 36.1.1 → 36.1.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.
Files changed (2) hide show
  1. package/index.js +3 -3
  2. package/package.json +1 -1
package/index.js CHANGED
@@ -2674,11 +2674,11 @@ class ChunkSplitter {
2674
2674
  for (const { ref: i, span: o } of e) await this.append(i, t + 1, o)
2675
2675
  r.length > 0 && (this.hasParity[t + 1] = !0)
2676
2676
  for (const { chunk: i, key: o } of r)
2677
- if (this.encrypted) {
2677
+ if ((this.chunks[t + 1].writer.max() === 0 && (await this.elevate(t + 1)), this.encrypted)) {
2678
2678
  const { address: s, key: c } = i.encryptedHash(o),
2679
2679
  u = new Uint8Array(64)
2680
- u.set(s), u.set(c, 32), await this.append(u, t + 1, i.span)
2681
- } else await this.append(i.hash(), t + 1, i.span)
2680
+ u.set(s), u.set(c, 32), this.chunks[t + 1].writer.write(new Uint8ArrayReader(u))
2681
+ } else this.chunks[t + 1].writer.write(new Uint8ArrayReader(i.hash()))
2682
2682
  }
2683
2683
  async finalize(t = 0) {
2684
2684
  return this.pending[t]?.length && (await this.flushBatch(t)), this.chunks[t + 1] ? (this.counters[t] === 1 ? (await this.elevate(t + 1), await this.flushBatch(t + 1), (this.chunks[t + 1] = this.chunks[t]), this.finalize(t + 1)) : (await this.elevate(t), await this.flushBatch(t), this.finalize(t + 1))) : (t >= 1 && this.onIntermediateChunk && this.onIntermediateChunk(this.chunks[t], this.hasParity[t] ?? !1), this.chunks[t])
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cafe-utility",
3
- "version": "36.1.1",
3
+ "version": "36.1.2",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "exports": {