lzma1 0.2.0 → 0.3.0

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/lib/index.js CHANGED
@@ -4,7 +4,6 @@
4
4
  * SPDX-License-Identifier: MIT
5
5
  */
6
6
  import { LZMA, } from "./lzma.js";
7
- export { LZMA } from "./lzma.js";
8
7
  export { CRC32_TABLE } from "./utils.js";
9
8
  /**
10
9
  * Compresses data using LZMA algorithm
package/lib/lz-window.js CHANGED
@@ -6,12 +6,12 @@ export class LzOutWindow {
6
6
  windowSize = 0;
7
7
  // Private Go-style properties
8
8
  w = null;
9
- buf = [];
9
+ buf;
10
10
  constructor(writer = null, windowSize = 4096) {
11
11
  this.w = writer;
12
12
  this.stream = writer;
13
13
  this.windowSize = windowSize;
14
- this.buf = new Array(windowSize);
14
+ this.buf = new Uint8Array(windowSize);
15
15
  this.buffer = this.buf;
16
16
  this.pos = 0;
17
17
  this.streamPos = 0;
@@ -65,8 +65,7 @@ export class LzOutWindow {
65
65
  */
66
66
  flush() {
67
67
  if (this.w && this.buffer && this.pos > 0) {
68
- const dataToWrite = this.buffer.slice(0, this.pos);
69
- this.w.write(dataToWrite);
68
+ this.w.writeBytes(this.buffer, 0, this.pos);
70
69
  this.pos = 0;
71
70
  }
72
71
  }