wao 0.11.0 → 0.11.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.
@@ -3,7 +3,7 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.Decompressor = exports.Compressor = void 0;
6
+ exports.Waosm = void 0;
7
7
  exports.__wbg_buffer_609cc3eee51ed158 = __wbg_buffer_609cc3eee51ed158;
8
8
  exports.__wbg_length_a446193dc22c12f8 = __wbg_length_a446193dc22c12f8;
9
9
  exports.__wbg_newwithbyteoffsetandlength_d97e637ebe145a9a = __wbg_newwithbyteoffsetandlength_d97e637ebe145a9a;
@@ -70,86 +70,57 @@ function passArray8ToWasm0(arg, malloc) {
70
70
  WASM_VECTOR_LEN = arg.length;
71
71
  return ptr;
72
72
  }
73
- var CompressorFinalization = typeof FinalizationRegistry === 'undefined' ? {
73
+ var WaosmFinalization = typeof FinalizationRegistry === 'undefined' ? {
74
74
  register: function register() {},
75
75
  unregister: function unregister() {}
76
76
  } : new FinalizationRegistry(function (ptr) {
77
- return wasm.__wbg_compressor_free(ptr >>> 0, 1);
77
+ return wasm.__wbg_waosm_free(ptr >>> 0, 1);
78
78
  });
79
- var Compressor = exports.Compressor = /*#__PURE__*/function () {
80
- function Compressor() {
81
- _classCallCheck(this, Compressor);
82
- var ret = wasm.compressor_new();
79
+ var Waosm = exports.Waosm = /*#__PURE__*/function () {
80
+ function Waosm() {
81
+ _classCallCheck(this, Waosm);
82
+ var ret = wasm.waosm_new();
83
83
  this.__wbg_ptr = ret >>> 0;
84
- CompressorFinalization.register(this, this.__wbg_ptr, this);
84
+ WaosmFinalization.register(this, this.__wbg_ptr, this);
85
85
  return this;
86
86
  }
87
87
  /**
88
88
  * @param {Uint8Array} data
89
89
  * @returns {Uint8Array}
90
90
  */
91
- return _createClass(Compressor, [{
91
+ return _createClass(Waosm, [{
92
92
  key: "__destroy_into_raw",
93
93
  value: function __destroy_into_raw() {
94
94
  var ptr = this.__wbg_ptr;
95
95
  this.__wbg_ptr = 0;
96
- CompressorFinalization.unregister(this);
96
+ WaosmFinalization.unregister(this);
97
97
  return ptr;
98
98
  }
99
99
  }, {
100
100
  key: "free",
101
101
  value: function free() {
102
102
  var ptr = this.__destroy_into_raw();
103
- wasm.__wbg_compressor_free(ptr, 0);
103
+ wasm.__wbg_waosm_free(ptr, 0);
104
104
  }
105
105
  }, {
106
106
  key: "compress",
107
107
  value: function compress(data) {
108
108
  var ptr0 = passArray8ToWasm0(data, wasm.__wbindgen_malloc);
109
109
  var len0 = WASM_VECTOR_LEN;
110
- var ret = wasm.compressor_compress(this.__wbg_ptr, ptr0, len0);
110
+ var ret = wasm.waosm_compress(this.__wbg_ptr, ptr0, len0);
111
111
  return takeObject(ret);
112
112
  }
113
- }]);
114
- }();
115
- var DecompressorFinalization = typeof FinalizationRegistry === 'undefined' ? {
116
- register: function register() {},
117
- unregister: function unregister() {}
118
- } : new FinalizationRegistry(function (ptr) {
119
- return wasm.__wbg_decompressor_free(ptr >>> 0, 1);
120
- });
121
- var Decompressor = exports.Decompressor = /*#__PURE__*/function () {
122
- function Decompressor() {
123
- _classCallCheck(this, Decompressor);
124
- var ret = wasm.compressor_new();
125
- this.__wbg_ptr = ret >>> 0;
126
- DecompressorFinalization.register(this, this.__wbg_ptr, this);
127
- return this;
128
- }
129
- /**
130
- * @param {Uint8Array} data
131
- * @returns {Uint8Array}
132
- */
133
- return _createClass(Decompressor, [{
134
- key: "__destroy_into_raw",
135
- value: function __destroy_into_raw() {
136
- var ptr = this.__wbg_ptr;
137
- this.__wbg_ptr = 0;
138
- DecompressorFinalization.unregister(this);
139
- return ptr;
140
- }
141
- }, {
142
- key: "free",
143
- value: function free() {
144
- var ptr = this.__destroy_into_raw();
145
- wasm.__wbg_decompressor_free(ptr, 0);
146
- }
113
+ /**
114
+ * @param {Uint8Array} data
115
+ * @param {number} decompressed_size
116
+ * @returns {Uint8Array}
117
+ */
147
118
  }, {
148
119
  key: "decompress",
149
- value: function decompress(data) {
120
+ value: function decompress(data, decompressed_size) {
150
121
  var ptr0 = passArray8ToWasm0(data, wasm.__wbindgen_malloc);
151
122
  var len0 = WASM_VECTOR_LEN;
152
- var ret = wasm.decompressor_decompress(this.__wbg_ptr, ptr0, len0);
123
+ var ret = wasm.waosm_decompress(this.__wbg_ptr, ptr0, len0, decompressed_size);
153
124
  return takeObject(ret);
154
125
  }
155
126
  }]);