@paddor/zrip 0.5.7 → 0.5.8

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@paddor/zrip",
3
- "version": "0.5.7",
3
+ "version": "0.5.8",
4
4
  "description": "Pure Rust zstd codec compiled to WebAssembly. Decodes all zstd levels, encodes -8..4, with SIMD auto-detection.",
5
5
  "license": "MIT",
6
6
  "type": "module",
Binary file
@@ -4,8 +4,8 @@
4
4
  export class Compressor {
5
5
  free(): void;
6
6
  [Symbol.dispose](): void;
7
- compress(input: Uint8Array): Uint8Array;
8
7
  compressWithDict(input: Uint8Array, dict: Dictionary): Uint8Array;
8
+ compress(input: Uint8Array): Uint8Array;
9
9
  constructor(level: number);
10
10
  static withDict(level: number, dict: Dictionary): Compressor;
11
11
  }
@@ -19,14 +19,16 @@ export class Compressor {
19
19
  }
20
20
  /**
21
21
  * @param {Uint8Array} input
22
+ * @param {Dictionary} dict
22
23
  * @returns {Uint8Array}
23
24
  */
24
- compress(input) {
25
+ compressWithDict(input, dict) {
25
26
  try {
26
27
  const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
27
28
  const ptr0 = passArray8ToWasm0(input, wasm.__wbindgen_export);
28
29
  const len0 = WASM_VECTOR_LEN;
29
- wasm.compressor_compress(retptr, this.__wbg_ptr, ptr0, len0);
30
+ _assertClass(dict, Dictionary);
31
+ wasm.compressor_compressWithDict(retptr, this.__wbg_ptr, ptr0, len0, dict.__wbg_ptr);
30
32
  var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
31
33
  var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
32
34
  var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
@@ -43,16 +45,14 @@ export class Compressor {
43
45
  }
44
46
  /**
45
47
  * @param {Uint8Array} input
46
- * @param {Dictionary} dict
47
48
  * @returns {Uint8Array}
48
49
  */
49
- compressWithDict(input, dict) {
50
+ compress(input) {
50
51
  try {
51
52
  const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
52
53
  const ptr0 = passArray8ToWasm0(input, wasm.__wbindgen_export);
53
54
  const len0 = WASM_VECTOR_LEN;
54
- _assertClass(dict, Dictionary);
55
- wasm.compressor_compressWithDict(retptr, this.__wbg_ptr, ptr0, len0, dict.__wbg_ptr);
55
+ wasm.compressor_compress(retptr, this.__wbg_ptr, ptr0, len0);
56
56
  var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
57
57
  var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
58
58
  var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
@@ -333,11 +333,11 @@ export function decompressWithDict(input, dict, max_output_size) {
333
333
  function __wbg_get_imports() {
334
334
  const import0 = {
335
335
  __proto__: null,
336
- __wbg_Error_408e67f47ca7b58b: function(arg0, arg1) {
336
+ __wbg_Error_67e7344beaa85059: function(arg0, arg1) {
337
337
  const ret = Error(getStringFromWasm0(arg0, arg1));
338
338
  return addHeapObject(ret);
339
339
  },
340
- __wbg___wbindgen_throw_bb96b2010945f0bc: function(arg0, arg1) {
340
+ __wbg___wbindgen_throw_5d9e815e6fdf150f: function(arg0, arg1) {
341
341
  throw new Error(getStringFromWasm0(arg0, arg1));
342
342
  },
343
343
  };
Binary file