@kerebron/odt-wasm 0.5.2 → 0.5.4

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/rs_lib.d.ts CHANGED
@@ -2,15 +2,21 @@
2
2
  // deno-lint-ignore-file
3
3
  // deno-fmt-ignore-file
4
4
 
5
- export function parse_content(xml_bytes: Uint8Array): any;
6
- export function unzip(zip_data: Uint8Array): any;
7
- export function init_debug(): void;
8
- export function add(a: number, b: number): number;
9
- export function echo(zip_data: Uint8Array): Uint8Array;
10
- export function parse_styles(xml_bytes: Uint8Array): any;
11
5
  export class Greeter {
12
6
  free(): void;
13
7
  [Symbol.dispose](): void;
14
8
  constructor(name: string);
15
9
  greet(): string;
16
10
  }
11
+
12
+ export function add(a: number, b: number): number;
13
+
14
+ export function echo(zip_data: Uint8Array): Uint8Array;
15
+
16
+ export function init_debug(): void;
17
+
18
+ export function parse_content(xml_bytes: Uint8Array): any;
19
+
20
+ export function parse_styles(xml_bytes: Uint8Array): any;
21
+
22
+ export function unzip(zip_data: Uint8Array): any;
@@ -8,46 +8,6 @@ export function __wbg_set_wasm(val) {
8
8
  wasm = val;
9
9
  }
10
10
 
11
- let cachedUint8ArrayMemory0 = null;
12
-
13
- function getUint8ArrayMemory0() {
14
- if (
15
- cachedUint8ArrayMemory0 === null || cachedUint8ArrayMemory0.byteLength === 0
16
- ) {
17
- cachedUint8ArrayMemory0 = new Uint8Array(wasm.memory.buffer);
18
- }
19
- return cachedUint8ArrayMemory0;
20
- }
21
-
22
- let cachedTextDecoder = new TextDecoder('utf-8', {
23
- ignoreBOM: true,
24
- fatal: true,
25
- });
26
-
27
- cachedTextDecoder.decode();
28
-
29
- const MAX_SAFARI_DECODE_BYTES = 2146435072;
30
- let numBytesDecoded = 0;
31
- function decodeText(ptr, len) {
32
- numBytesDecoded += len;
33
- if (numBytesDecoded >= MAX_SAFARI_DECODE_BYTES) {
34
- cachedTextDecoder = new TextDecoder('utf-8', {
35
- ignoreBOM: true,
36
- fatal: true,
37
- });
38
- cachedTextDecoder.decode();
39
- numBytesDecoded = len;
40
- }
41
- return cachedTextDecoder.decode(
42
- getUint8ArrayMemory0().subarray(ptr, ptr + len),
43
- );
44
- }
45
-
46
- function getStringFromWasm0(ptr, len) {
47
- ptr = ptr >>> 0;
48
- return decodeText(ptr, len);
49
- }
50
-
51
11
  function debugString(val) {
52
12
  // primitive types
53
13
  const type = typeof val;
@@ -113,19 +73,44 @@ function debugString(val) {
113
73
  return className;
114
74
  }
115
75
 
116
- let WASM_VECTOR_LEN = 0;
76
+ function getArrayU8FromWasm0(ptr, len) {
77
+ ptr = ptr >>> 0;
78
+ return getUint8ArrayMemory0().subarray(ptr / 1, ptr / 1 + len);
79
+ }
117
80
 
118
- const cachedTextEncoder = new TextEncoder();
81
+ let cachedDataViewMemory0 = null;
82
+ function getDataViewMemory0() {
83
+ if (
84
+ cachedDataViewMemory0 === null ||
85
+ cachedDataViewMemory0.buffer.detached === true ||
86
+ (cachedDataViewMemory0.buffer.detached === undefined &&
87
+ cachedDataViewMemory0.buffer !== wasm.memory.buffer)
88
+ ) {
89
+ cachedDataViewMemory0 = new DataView(wasm.memory.buffer);
90
+ }
91
+ return cachedDataViewMemory0;
92
+ }
119
93
 
120
- if (!('encodeInto' in cachedTextEncoder)) {
121
- cachedTextEncoder.encodeInto = function (arg, view) {
122
- const buf = cachedTextEncoder.encode(arg);
123
- view.set(buf);
124
- return {
125
- read: arg.length,
126
- written: buf.length,
127
- };
128
- };
94
+ function getStringFromWasm0(ptr, len) {
95
+ ptr = ptr >>> 0;
96
+ return decodeText(ptr, len);
97
+ }
98
+
99
+ let cachedUint8ArrayMemory0 = null;
100
+ function getUint8ArrayMemory0() {
101
+ if (
102
+ cachedUint8ArrayMemory0 === null || cachedUint8ArrayMemory0.byteLength === 0
103
+ ) {
104
+ cachedUint8ArrayMemory0 = new Uint8Array(wasm.memory.buffer);
105
+ }
106
+ return cachedUint8ArrayMemory0;
107
+ }
108
+
109
+ function passArray8ToWasm0(arg, malloc) {
110
+ const ptr = malloc(arg.length * 1, 1) >>> 0;
111
+ getUint8ArrayMemory0().set(arg, ptr / 1);
112
+ WASM_VECTOR_LEN = arg.length;
113
+ return ptr;
129
114
  }
130
115
 
131
116
  function passStringToWasm0(arg, malloc, realloc) {
@@ -149,7 +134,6 @@ function passStringToWasm0(arg, malloc, realloc) {
149
134
  if (code > 0x7F) break;
150
135
  mem[ptr + offset] = code;
151
136
  }
152
-
153
137
  if (offset !== len) {
154
138
  if (offset !== 0) {
155
139
  arg = arg.slice(offset);
@@ -166,89 +150,42 @@ function passStringToWasm0(arg, malloc, realloc) {
166
150
  return ptr;
167
151
  }
168
152
 
169
- let cachedDataViewMemory0 = null;
170
-
171
- function getDataViewMemory0() {
172
- if (
173
- cachedDataViewMemory0 === null ||
174
- cachedDataViewMemory0.buffer.detached === true ||
175
- (cachedDataViewMemory0.buffer.detached === undefined &&
176
- cachedDataViewMemory0.buffer !== wasm.memory.buffer)
177
- ) {
178
- cachedDataViewMemory0 = new DataView(wasm.memory.buffer);
153
+ let cachedTextDecoder = new TextDecoder('utf-8', {
154
+ ignoreBOM: true,
155
+ fatal: true,
156
+ });
157
+ cachedTextDecoder.decode();
158
+ const MAX_SAFARI_DECODE_BYTES = 2146435072;
159
+ let numBytesDecoded = 0;
160
+ function decodeText(ptr, len) {
161
+ numBytesDecoded += len;
162
+ if (numBytesDecoded >= MAX_SAFARI_DECODE_BYTES) {
163
+ cachedTextDecoder = new TextDecoder('utf-8', {
164
+ ignoreBOM: true,
165
+ fatal: true,
166
+ });
167
+ cachedTextDecoder.decode();
168
+ numBytesDecoded = len;
179
169
  }
180
- return cachedDataViewMemory0;
181
- }
182
-
183
- function passArray8ToWasm0(arg, malloc) {
184
- const ptr = malloc(arg.length * 1, 1) >>> 0;
185
- getUint8ArrayMemory0().set(arg, ptr / 1);
186
- WASM_VECTOR_LEN = arg.length;
187
- return ptr;
188
- }
189
- /**
190
- * @param {Uint8Array} xml_bytes
191
- * @returns {any}
192
- */
193
- export function parse_content(xml_bytes) {
194
- const ptr0 = passArray8ToWasm0(xml_bytes, wasm.__wbindgen_malloc);
195
- const len0 = WASM_VECTOR_LEN;
196
- const ret = wasm.parse_content(ptr0, len0);
197
- return ret;
198
- }
199
-
200
- /**
201
- * @param {Uint8Array} zip_data
202
- * @returns {any}
203
- */
204
- export function unzip(zip_data) {
205
- const ptr0 = passArray8ToWasm0(zip_data, wasm.__wbindgen_malloc);
206
- const len0 = WASM_VECTOR_LEN;
207
- const ret = wasm.unzip(ptr0, len0);
208
- return ret;
209
- }
210
-
211
- export function init_debug() {
212
- wasm.init_debug();
170
+ return cachedTextDecoder.decode(
171
+ getUint8ArrayMemory0().subarray(ptr, ptr + len),
172
+ );
213
173
  }
214
174
 
215
- /**
216
- * @param {number} a
217
- * @param {number} b
218
- * @returns {number}
219
- */
220
- export function add(a, b) {
221
- const ret = wasm.add(a, b);
222
- return ret;
223
- }
175
+ const cachedTextEncoder = new TextEncoder();
224
176
 
225
- function getArrayU8FromWasm0(ptr, len) {
226
- ptr = ptr >>> 0;
227
- return getUint8ArrayMemory0().subarray(ptr / 1, ptr / 1 + len);
228
- }
229
- /**
230
- * @param {Uint8Array} zip_data
231
- * @returns {Uint8Array}
232
- */
233
- export function echo(zip_data) {
234
- const ptr0 = passArray8ToWasm0(zip_data, wasm.__wbindgen_malloc);
235
- const len0 = WASM_VECTOR_LEN;
236
- const ret = wasm.echo(ptr0, len0);
237
- var v2 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
238
- wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
239
- return v2;
177
+ if (!('encodeInto' in cachedTextEncoder)) {
178
+ cachedTextEncoder.encodeInto = function (arg, view) {
179
+ const buf = cachedTextEncoder.encode(arg);
180
+ view.set(buf);
181
+ return {
182
+ read: arg.length,
183
+ written: buf.length,
184
+ };
185
+ };
240
186
  }
241
187
 
242
- /**
243
- * @param {Uint8Array} xml_bytes
244
- * @returns {any}
245
- */
246
- export function parse_styles(xml_bytes) {
247
- const ptr0 = passArray8ToWasm0(xml_bytes, wasm.__wbindgen_malloc);
248
- const len0 = WASM_VECTOR_LEN;
249
- const ret = wasm.parse_styles(ptr0, len0);
250
- return ret;
251
- }
188
+ let WASM_VECTOR_LEN = 0;
252
189
 
253
190
  const GreeterFinalization = (typeof FinalizationRegistry === 'undefined')
254
191
  ? { register: () => {}, unregister: () => {} }
@@ -261,7 +198,6 @@ export class Greeter {
261
198
  GreeterFinalization.unregister(this);
262
199
  return ptr;
263
200
  }
264
-
265
201
  free() {
266
202
  const ptr = this.__destroy_into_raw();
267
203
  wasm.__wbg_greeter_free(ptr, 0);
@@ -299,17 +235,77 @@ export class Greeter {
299
235
  }
300
236
  if (Symbol.dispose) Greeter.prototype[Symbol.dispose] = Greeter.prototype.free;
301
237
 
302
- export function __wbg_Error_e83987f665cf5504(arg0, arg1) {
238
+ /**
239
+ * @param {number} a
240
+ * @param {number} b
241
+ * @returns {number}
242
+ */
243
+ export function add(a, b) {
244
+ const ret = wasm.add(a, b);
245
+ return ret;
246
+ }
247
+
248
+ /**
249
+ * @param {Uint8Array} zip_data
250
+ * @returns {Uint8Array}
251
+ */
252
+ export function echo(zip_data) {
253
+ const ptr0 = passArray8ToWasm0(zip_data, wasm.__wbindgen_malloc);
254
+ const len0 = WASM_VECTOR_LEN;
255
+ const ret = wasm.echo(ptr0, len0);
256
+ var v2 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
257
+ wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
258
+ return v2;
259
+ }
260
+
261
+ export function init_debug() {
262
+ wasm.init_debug();
263
+ }
264
+
265
+ /**
266
+ * @param {Uint8Array} xml_bytes
267
+ * @returns {any}
268
+ */
269
+ export function parse_content(xml_bytes) {
270
+ const ptr0 = passArray8ToWasm0(xml_bytes, wasm.__wbindgen_malloc);
271
+ const len0 = WASM_VECTOR_LEN;
272
+ const ret = wasm.parse_content(ptr0, len0);
273
+ return ret;
274
+ }
275
+
276
+ /**
277
+ * @param {Uint8Array} xml_bytes
278
+ * @returns {any}
279
+ */
280
+ export function parse_styles(xml_bytes) {
281
+ const ptr0 = passArray8ToWasm0(xml_bytes, wasm.__wbindgen_malloc);
282
+ const len0 = WASM_VECTOR_LEN;
283
+ const ret = wasm.parse_styles(ptr0, len0);
284
+ return ret;
285
+ }
286
+
287
+ /**
288
+ * @param {Uint8Array} zip_data
289
+ * @returns {any}
290
+ */
291
+ export function unzip(zip_data) {
292
+ const ptr0 = passArray8ToWasm0(zip_data, wasm.__wbindgen_malloc);
293
+ const len0 = WASM_VECTOR_LEN;
294
+ const ret = wasm.unzip(ptr0, len0);
295
+ return ret;
296
+ }
297
+
298
+ export function __wbg_Error_52673b7de5a0ca89(arg0, arg1) {
303
299
  const ret = Error(getStringFromWasm0(arg0, arg1));
304
300
  return ret;
305
301
  }
306
302
 
307
- export function __wbg_Number_bb48ca12f395cd08(arg0) {
303
+ export function __wbg_Number_2d1dcfcf4ec51736(arg0) {
308
304
  const ret = Number(arg0);
309
305
  return ret;
310
306
  }
311
307
 
312
- export function __wbg___wbindgen_debug_string_df47ffb5e35e6763(arg0, arg1) {
308
+ export function __wbg___wbindgen_debug_string_adfb662ae34724b6(arg0, arg1) {
313
309
  const ret = debugString(arg1);
314
310
  const ptr1 = passStringToWasm0(
315
311
  ret,
@@ -321,12 +317,12 @@ export function __wbg___wbindgen_debug_string_df47ffb5e35e6763(arg0, arg1) {
321
317
  getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
322
318
  }
323
319
 
324
- export function __wbg___wbindgen_is_string_fbb76cb2940daafd(arg0) {
320
+ export function __wbg___wbindgen_is_string_704ef9c8fc131030(arg0) {
325
321
  const ret = typeof arg0 === 'string';
326
322
  return ret;
327
323
  }
328
324
 
329
- export function __wbg___wbindgen_throw_b855445ff6a94295(arg0, arg1) {
325
+ export function __wbg___wbindgen_throw_dd24417ed36fc46e(arg0, arg1) {
330
326
  throw new Error(getStringFromWasm0(arg0, arg1));
331
327
  }
332
328
 
@@ -342,13 +338,13 @@ export function __wbg_error_7534b8e9a36f1ab4(arg0, arg1) {
342
338
  }
343
339
  }
344
340
 
345
- export function __wbg_new_1acc0b6eea89d040() {
341
+ export function __wbg_new_1ba21ce319a06297() {
346
342
  const ret = new Object();
347
343
  return ret;
348
344
  }
349
345
 
350
- export function __wbg_new_68651c719dcda04e() {
351
- const ret = new Map();
346
+ export function __wbg_new_25f239778d6112b9() {
347
+ const ret = new Array();
352
348
  return ret;
353
349
  }
354
350
 
@@ -357,8 +353,8 @@ export function __wbg_new_8a6f238a6ece86ea() {
357
353
  return ret;
358
354
  }
359
355
 
360
- export function __wbg_new_e17d9f43105b08be() {
361
- const ret = new Array();
356
+ export function __wbg_new_b546ae120718850e() {
357
+ const ret = new Map();
362
358
  return ret;
363
359
  }
364
360
 
@@ -366,13 +362,13 @@ export function __wbg_set_3f1d0b984ed272ed(arg0, arg1, arg2) {
366
362
  arg0[arg1] = arg2;
367
363
  }
368
364
 
369
- export function __wbg_set_907fb406c34a251d(arg0, arg1, arg2) {
370
- const ret = arg0.set(arg1, arg2);
371
- return ret;
365
+ export function __wbg_set_7df433eea03a5c14(arg0, arg1, arg2) {
366
+ arg0[arg1 >>> 0] = arg2;
372
367
  }
373
368
 
374
- export function __wbg_set_c213c871859d6500(arg0, arg1, arg2) {
375
- arg0[arg1 >>> 0] = arg2;
369
+ export function __wbg_set_efaaf145b9377369(arg0, arg1, arg2) {
370
+ const ret = arg0.set(arg1, arg2);
371
+ return ret;
376
372
  }
377
373
 
378
374
  export function __wbg_stack_0ed75d68575b0f3c(arg0, arg1) {
package/lib/rs_lib.js CHANGED
@@ -4,7 +4,7 @@
4
4
  // deno-fmt-ignore-file
5
5
  // @ts-self-types="./rs_lib.d.ts"
6
6
 
7
- // source-hash: fb9a97cb16901678b9b7f2462418503de3bd0fe0
7
+ // source-hash: aaf646bb4ea0c77254ac0a46be962265644a4d52
8
8
  import * as wasm from "./rs_lib.wasm";
9
9
  export * from "./rs_lib.internal.js";
10
10
  import { __wbg_set_wasm } from "./rs_lib.internal.js";
package/lib/rs_lib.wasm CHANGED
Binary file
@@ -2,15 +2,21 @@
2
2
  // deno-lint-ignore-file
3
3
  // deno-fmt-ignore-file
4
4
 
5
- export function unzip(zip_data: Uint8Array): any;
6
- export function init_debug(): void;
7
- export function parse_styles(xml_bytes: Uint8Array): any;
8
- export function parse_content(xml_bytes: Uint8Array): any;
9
- export function add(a: number, b: number): number;
10
- export function echo(zip_data: Uint8Array): Uint8Array;
11
5
  export class Greeter {
12
6
  free(): void;
13
7
  [Symbol.dispose](): void;
14
8
  constructor(name: string);
15
9
  greet(): string;
16
10
  }
11
+
12
+ export function add(a: number, b: number): number;
13
+
14
+ export function echo(zip_data: Uint8Array): Uint8Array;
15
+
16
+ export function init_debug(): void;
17
+
18
+ export function parse_content(xml_bytes: Uint8Array): any;
19
+
20
+ export function parse_styles(xml_bytes: Uint8Array): any;
21
+
22
+ export function unzip(zip_data: Uint8Array): any;
@@ -8,46 +8,6 @@ export function __wbg_set_wasm(val) {
8
8
  wasm = val;
9
9
  }
10
10
 
11
- let cachedUint8ArrayMemory0 = null;
12
-
13
- function getUint8ArrayMemory0() {
14
- if (
15
- cachedUint8ArrayMemory0 === null || cachedUint8ArrayMemory0.byteLength === 0
16
- ) {
17
- cachedUint8ArrayMemory0 = new Uint8Array(wasm.memory.buffer);
18
- }
19
- return cachedUint8ArrayMemory0;
20
- }
21
-
22
- let cachedTextDecoder = new TextDecoder('utf-8', {
23
- ignoreBOM: true,
24
- fatal: true,
25
- });
26
-
27
- cachedTextDecoder.decode();
28
-
29
- const MAX_SAFARI_DECODE_BYTES = 2146435072;
30
- let numBytesDecoded = 0;
31
- function decodeText(ptr, len) {
32
- numBytesDecoded += len;
33
- if (numBytesDecoded >= MAX_SAFARI_DECODE_BYTES) {
34
- cachedTextDecoder = new TextDecoder('utf-8', {
35
- ignoreBOM: true,
36
- fatal: true,
37
- });
38
- cachedTextDecoder.decode();
39
- numBytesDecoded = len;
40
- }
41
- return cachedTextDecoder.decode(
42
- getUint8ArrayMemory0().subarray(ptr, ptr + len),
43
- );
44
- }
45
-
46
- function getStringFromWasm0(ptr, len) {
47
- ptr = ptr >>> 0;
48
- return decodeText(ptr, len);
49
- }
50
-
51
11
  function debugString(val) {
52
12
  // primitive types
53
13
  const type = typeof val;
@@ -113,19 +73,44 @@ function debugString(val) {
113
73
  return className;
114
74
  }
115
75
 
116
- let WASM_VECTOR_LEN = 0;
76
+ function getArrayU8FromWasm0(ptr, len) {
77
+ ptr = ptr >>> 0;
78
+ return getUint8ArrayMemory0().subarray(ptr / 1, ptr / 1 + len);
79
+ }
117
80
 
118
- const cachedTextEncoder = new TextEncoder();
81
+ let cachedDataViewMemory0 = null;
82
+ function getDataViewMemory0() {
83
+ if (
84
+ cachedDataViewMemory0 === null ||
85
+ cachedDataViewMemory0.buffer.detached === true ||
86
+ (cachedDataViewMemory0.buffer.detached === undefined &&
87
+ cachedDataViewMemory0.buffer !== wasm.memory.buffer)
88
+ ) {
89
+ cachedDataViewMemory0 = new DataView(wasm.memory.buffer);
90
+ }
91
+ return cachedDataViewMemory0;
92
+ }
119
93
 
120
- if (!('encodeInto' in cachedTextEncoder)) {
121
- cachedTextEncoder.encodeInto = function (arg, view) {
122
- const buf = cachedTextEncoder.encode(arg);
123
- view.set(buf);
124
- return {
125
- read: arg.length,
126
- written: buf.length,
127
- };
128
- };
94
+ function getStringFromWasm0(ptr, len) {
95
+ ptr = ptr >>> 0;
96
+ return decodeText(ptr, len);
97
+ }
98
+
99
+ let cachedUint8ArrayMemory0 = null;
100
+ function getUint8ArrayMemory0() {
101
+ if (
102
+ cachedUint8ArrayMemory0 === null || cachedUint8ArrayMemory0.byteLength === 0
103
+ ) {
104
+ cachedUint8ArrayMemory0 = new Uint8Array(wasm.memory.buffer);
105
+ }
106
+ return cachedUint8ArrayMemory0;
107
+ }
108
+
109
+ function passArray8ToWasm0(arg, malloc) {
110
+ const ptr = malloc(arg.length * 1, 1) >>> 0;
111
+ getUint8ArrayMemory0().set(arg, ptr / 1);
112
+ WASM_VECTOR_LEN = arg.length;
113
+ return ptr;
129
114
  }
130
115
 
131
116
  function passStringToWasm0(arg, malloc, realloc) {
@@ -149,7 +134,6 @@ function passStringToWasm0(arg, malloc, realloc) {
149
134
  if (code > 0x7F) break;
150
135
  mem[ptr + offset] = code;
151
136
  }
152
-
153
137
  if (offset !== len) {
154
138
  if (offset !== 0) {
155
139
  arg = arg.slice(offset);
@@ -166,89 +150,42 @@ function passStringToWasm0(arg, malloc, realloc) {
166
150
  return ptr;
167
151
  }
168
152
 
169
- let cachedDataViewMemory0 = null;
170
-
171
- function getDataViewMemory0() {
172
- if (
173
- cachedDataViewMemory0 === null ||
174
- cachedDataViewMemory0.buffer.detached === true ||
175
- (cachedDataViewMemory0.buffer.detached === undefined &&
176
- cachedDataViewMemory0.buffer !== wasm.memory.buffer)
177
- ) {
178
- cachedDataViewMemory0 = new DataView(wasm.memory.buffer);
153
+ let cachedTextDecoder = new TextDecoder('utf-8', {
154
+ ignoreBOM: true,
155
+ fatal: true,
156
+ });
157
+ cachedTextDecoder.decode();
158
+ const MAX_SAFARI_DECODE_BYTES = 2146435072;
159
+ let numBytesDecoded = 0;
160
+ function decodeText(ptr, len) {
161
+ numBytesDecoded += len;
162
+ if (numBytesDecoded >= MAX_SAFARI_DECODE_BYTES) {
163
+ cachedTextDecoder = new TextDecoder('utf-8', {
164
+ ignoreBOM: true,
165
+ fatal: true,
166
+ });
167
+ cachedTextDecoder.decode();
168
+ numBytesDecoded = len;
179
169
  }
180
- return cachedDataViewMemory0;
181
- }
182
-
183
- function passArray8ToWasm0(arg, malloc) {
184
- const ptr = malloc(arg.length * 1, 1) >>> 0;
185
- getUint8ArrayMemory0().set(arg, ptr / 1);
186
- WASM_VECTOR_LEN = arg.length;
187
- return ptr;
188
- }
189
- /**
190
- * @param {Uint8Array} zip_data
191
- * @returns {any}
192
- */
193
- export function unzip(zip_data) {
194
- const ptr0 = passArray8ToWasm0(zip_data, wasm.__wbindgen_malloc);
195
- const len0 = WASM_VECTOR_LEN;
196
- const ret = wasm.unzip(ptr0, len0);
197
- return ret;
198
- }
199
-
200
- export function init_debug() {
201
- wasm.init_debug();
202
- }
203
-
204
- /**
205
- * @param {Uint8Array} xml_bytes
206
- * @returns {any}
207
- */
208
- export function parse_styles(xml_bytes) {
209
- const ptr0 = passArray8ToWasm0(xml_bytes, wasm.__wbindgen_malloc);
210
- const len0 = WASM_VECTOR_LEN;
211
- const ret = wasm.parse_styles(ptr0, len0);
212
- return ret;
170
+ return cachedTextDecoder.decode(
171
+ getUint8ArrayMemory0().subarray(ptr, ptr + len),
172
+ );
213
173
  }
214
174
 
215
- /**
216
- * @param {Uint8Array} xml_bytes
217
- * @returns {any}
218
- */
219
- export function parse_content(xml_bytes) {
220
- const ptr0 = passArray8ToWasm0(xml_bytes, wasm.__wbindgen_malloc);
221
- const len0 = WASM_VECTOR_LEN;
222
- const ret = wasm.parse_content(ptr0, len0);
223
- return ret;
224
- }
175
+ const cachedTextEncoder = new TextEncoder();
225
176
 
226
- /**
227
- * @param {number} a
228
- * @param {number} b
229
- * @returns {number}
230
- */
231
- export function add(a, b) {
232
- const ret = wasm.add(a, b);
233
- return ret;
177
+ if (!('encodeInto' in cachedTextEncoder)) {
178
+ cachedTextEncoder.encodeInto = function (arg, view) {
179
+ const buf = cachedTextEncoder.encode(arg);
180
+ view.set(buf);
181
+ return {
182
+ read: arg.length,
183
+ written: buf.length,
184
+ };
185
+ };
234
186
  }
235
187
 
236
- function getArrayU8FromWasm0(ptr, len) {
237
- ptr = ptr >>> 0;
238
- return getUint8ArrayMemory0().subarray(ptr / 1, ptr / 1 + len);
239
- }
240
- /**
241
- * @param {Uint8Array} zip_data
242
- * @returns {Uint8Array}
243
- */
244
- export function echo(zip_data) {
245
- const ptr0 = passArray8ToWasm0(zip_data, wasm.__wbindgen_malloc);
246
- const len0 = WASM_VECTOR_LEN;
247
- const ret = wasm.echo(ptr0, len0);
248
- var v2 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
249
- wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
250
- return v2;
251
- }
188
+ let WASM_VECTOR_LEN = 0;
252
189
 
253
190
  const GreeterFinalization = (typeof FinalizationRegistry === 'undefined')
254
191
  ? { register: () => {}, unregister: () => {} }
@@ -261,7 +198,6 @@ export class Greeter {
261
198
  GreeterFinalization.unregister(this);
262
199
  return ptr;
263
200
  }
264
-
265
201
  free() {
266
202
  const ptr = this.__destroy_into_raw();
267
203
  wasm.__wbg_greeter_free(ptr, 0);
@@ -299,17 +235,77 @@ export class Greeter {
299
235
  }
300
236
  if (Symbol.dispose) Greeter.prototype[Symbol.dispose] = Greeter.prototype.free;
301
237
 
302
- export function __wbg_Error_e83987f665cf5504(arg0, arg1) {
238
+ /**
239
+ * @param {number} a
240
+ * @param {number} b
241
+ * @returns {number}
242
+ */
243
+ export function add(a, b) {
244
+ const ret = wasm.add(a, b);
245
+ return ret;
246
+ }
247
+
248
+ /**
249
+ * @param {Uint8Array} zip_data
250
+ * @returns {Uint8Array}
251
+ */
252
+ export function echo(zip_data) {
253
+ const ptr0 = passArray8ToWasm0(zip_data, wasm.__wbindgen_malloc);
254
+ const len0 = WASM_VECTOR_LEN;
255
+ const ret = wasm.echo(ptr0, len0);
256
+ var v2 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
257
+ wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
258
+ return v2;
259
+ }
260
+
261
+ export function init_debug() {
262
+ wasm.init_debug();
263
+ }
264
+
265
+ /**
266
+ * @param {Uint8Array} xml_bytes
267
+ * @returns {any}
268
+ */
269
+ export function parse_content(xml_bytes) {
270
+ const ptr0 = passArray8ToWasm0(xml_bytes, wasm.__wbindgen_malloc);
271
+ const len0 = WASM_VECTOR_LEN;
272
+ const ret = wasm.parse_content(ptr0, len0);
273
+ return ret;
274
+ }
275
+
276
+ /**
277
+ * @param {Uint8Array} xml_bytes
278
+ * @returns {any}
279
+ */
280
+ export function parse_styles(xml_bytes) {
281
+ const ptr0 = passArray8ToWasm0(xml_bytes, wasm.__wbindgen_malloc);
282
+ const len0 = WASM_VECTOR_LEN;
283
+ const ret = wasm.parse_styles(ptr0, len0);
284
+ return ret;
285
+ }
286
+
287
+ /**
288
+ * @param {Uint8Array} zip_data
289
+ * @returns {any}
290
+ */
291
+ export function unzip(zip_data) {
292
+ const ptr0 = passArray8ToWasm0(zip_data, wasm.__wbindgen_malloc);
293
+ const len0 = WASM_VECTOR_LEN;
294
+ const ret = wasm.unzip(ptr0, len0);
295
+ return ret;
296
+ }
297
+
298
+ export function __wbg_Error_52673b7de5a0ca89(arg0, arg1) {
303
299
  const ret = Error(getStringFromWasm0(arg0, arg1));
304
300
  return ret;
305
301
  }
306
302
 
307
- export function __wbg_Number_bb48ca12f395cd08(arg0) {
303
+ export function __wbg_Number_2d1dcfcf4ec51736(arg0) {
308
304
  const ret = Number(arg0);
309
305
  return ret;
310
306
  }
311
307
 
312
- export function __wbg___wbindgen_debug_string_df47ffb5e35e6763(arg0, arg1) {
308
+ export function __wbg___wbindgen_debug_string_adfb662ae34724b6(arg0, arg1) {
313
309
  const ret = debugString(arg1);
314
310
  const ptr1 = passStringToWasm0(
315
311
  ret,
@@ -321,12 +317,12 @@ export function __wbg___wbindgen_debug_string_df47ffb5e35e6763(arg0, arg1) {
321
317
  getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
322
318
  }
323
319
 
324
- export function __wbg___wbindgen_is_string_fbb76cb2940daafd(arg0) {
320
+ export function __wbg___wbindgen_is_string_704ef9c8fc131030(arg0) {
325
321
  const ret = typeof arg0 === 'string';
326
322
  return ret;
327
323
  }
328
324
 
329
- export function __wbg___wbindgen_throw_b855445ff6a94295(arg0, arg1) {
325
+ export function __wbg___wbindgen_throw_dd24417ed36fc46e(arg0, arg1) {
330
326
  throw new Error(getStringFromWasm0(arg0, arg1));
331
327
  }
332
328
 
@@ -342,13 +338,13 @@ export function __wbg_error_7534b8e9a36f1ab4(arg0, arg1) {
342
338
  }
343
339
  }
344
340
 
345
- export function __wbg_new_1acc0b6eea89d040() {
341
+ export function __wbg_new_1ba21ce319a06297() {
346
342
  const ret = new Object();
347
343
  return ret;
348
344
  }
349
345
 
350
- export function __wbg_new_68651c719dcda04e() {
351
- const ret = new Map();
346
+ export function __wbg_new_25f239778d6112b9() {
347
+ const ret = new Array();
352
348
  return ret;
353
349
  }
354
350
 
@@ -357,8 +353,8 @@ export function __wbg_new_8a6f238a6ece86ea() {
357
353
  return ret;
358
354
  }
359
355
 
360
- export function __wbg_new_e17d9f43105b08be() {
361
- const ret = new Array();
356
+ export function __wbg_new_b546ae120718850e() {
357
+ const ret = new Map();
362
358
  return ret;
363
359
  }
364
360
 
@@ -366,13 +362,13 @@ export function __wbg_set_3f1d0b984ed272ed(arg0, arg1, arg2) {
366
362
  arg0[arg1] = arg2;
367
363
  }
368
364
 
369
- export function __wbg_set_907fb406c34a251d(arg0, arg1, arg2) {
370
- const ret = arg0.set(arg1, arg2);
371
- return ret;
365
+ export function __wbg_set_7df433eea03a5c14(arg0, arg1, arg2) {
366
+ arg0[arg1 >>> 0] = arg2;
372
367
  }
373
368
 
374
- export function __wbg_set_c213c871859d6500(arg0, arg1, arg2) {
375
- arg0[arg1 >>> 0] = arg2;
369
+ export function __wbg_set_efaaf145b9377369(arg0, arg1, arg2) {
370
+ const ret = arg0.set(arg1, arg2);
371
+ return ret;
376
372
  }
377
373
 
378
374
  export function __wbg_stack_0ed75d68575b0f3c(arg0, arg1) {
@@ -4,7 +4,7 @@
4
4
  // deno-fmt-ignore-file
5
5
  // @ts-self-types="./rs_lib.d.ts"
6
6
 
7
- // source-hash: fb9a97cb16901678b9b7f2462418503de3bd0fe0
7
+ // source-hash: aaf646bb4ea0c77254ac0a46be962265644a4d52
8
8
  import * as wasm from "./rs_lib.wasm";
9
9
  export * from "./rs_lib.internal.js";
10
10
  import { __wbg_set_wasm } from "./rs_lib.internal.js";
Binary file
package/package.json CHANGED
@@ -1,19 +1,19 @@
1
1
  {
2
2
  "name": "@kerebron/odt-wasm",
3
3
  "type": "module",
4
- "main": "./lib/rs_lib.js",
4
+ "main": "./lib.js",
5
5
  "files": [
6
6
  "lib/",
7
7
  "lib-debug/"
8
8
  ],
9
9
  "exports": {
10
10
  ".": {
11
- "import": "./lib/rs_lib.js"
11
+ "import": "./lib.js"
12
12
  },
13
13
  "./debug": {
14
- "import": "./lib-debug/rs_lib.js"
14
+ "import": "./lib-debug.js"
15
15
  }
16
16
  },
17
- "version": "0.5.2",
17
+ "version": "0.5.4",
18
18
  "license": "MIT"
19
19
  }