@kerebron/odt-wasm 0.4.28 → 0.4.30
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 +5 -3
- package/lib/rs_lib.internal.js +133 -92
- package/lib/rs_lib.js +1 -1
- package/lib/rs_lib.wasm +0 -0
- package/lib-debug/rs_lib.d.ts +16 -0
- package/lib-debug/rs_lib.internal.js +410 -0
- package/lib-debug/rs_lib.js +12 -0
- package/lib-debug/rs_lib.wasm +0 -0
- package/package.json +6 -2
package/lib/rs_lib.d.ts
CHANGED
|
@@ -3,12 +3,14 @@
|
|
|
3
3
|
// deno-fmt-ignore-file
|
|
4
4
|
|
|
5
5
|
export function parse_content(xml_bytes: Uint8Array): any;
|
|
6
|
-
export function parse_styles(xml_bytes: Uint8Array): any;
|
|
7
|
-
export function echo(zip_data: Uint8Array): Uint8Array;
|
|
8
|
-
export function add(a: number, b: number): number;
|
|
9
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;
|
|
10
11
|
export class Greeter {
|
|
11
12
|
free(): void;
|
|
13
|
+
[Symbol.dispose](): void;
|
|
12
14
|
constructor(name: string);
|
|
13
15
|
greet(): string;
|
|
14
16
|
}
|
package/lib/rs_lib.internal.js
CHANGED
|
@@ -8,6 +8,46 @@ 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
|
+
|
|
11
51
|
function debugString(val) {
|
|
12
52
|
// primitive types
|
|
13
53
|
const type = typeof val;
|
|
@@ -75,28 +115,10 @@ function debugString(val) {
|
|
|
75
115
|
|
|
76
116
|
let WASM_VECTOR_LEN = 0;
|
|
77
117
|
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
function getUint8ArrayMemory0() {
|
|
81
|
-
if (
|
|
82
|
-
cachedUint8ArrayMemory0 === null || cachedUint8ArrayMemory0.byteLength === 0
|
|
83
|
-
) {
|
|
84
|
-
cachedUint8ArrayMemory0 = new Uint8Array(wasm.memory.buffer);
|
|
85
|
-
}
|
|
86
|
-
return cachedUint8ArrayMemory0;
|
|
87
|
-
}
|
|
88
|
-
|
|
89
|
-
const lTextEncoder = typeof TextEncoder === 'undefined'
|
|
90
|
-
? (0, module.require)('util').TextEncoder
|
|
91
|
-
: TextEncoder;
|
|
92
|
-
|
|
93
|
-
let cachedTextEncoder = new lTextEncoder('utf-8');
|
|
118
|
+
const cachedTextEncoder = new TextEncoder();
|
|
94
119
|
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
return cachedTextEncoder.encodeInto(arg, view);
|
|
98
|
-
}
|
|
99
|
-
: function (arg, view) {
|
|
120
|
+
if (!('encodeInto' in cachedTextEncoder)) {
|
|
121
|
+
cachedTextEncoder.encodeInto = function (arg, view) {
|
|
100
122
|
const buf = cachedTextEncoder.encode(arg);
|
|
101
123
|
view.set(buf);
|
|
102
124
|
return {
|
|
@@ -104,6 +126,7 @@ const encodeString = typeof cachedTextEncoder.encodeInto === 'function'
|
|
|
104
126
|
written: buf.length,
|
|
105
127
|
};
|
|
106
128
|
};
|
|
129
|
+
}
|
|
107
130
|
|
|
108
131
|
function passStringToWasm0(arg, malloc, realloc) {
|
|
109
132
|
if (realloc === undefined) {
|
|
@@ -133,7 +156,7 @@ function passStringToWasm0(arg, malloc, realloc) {
|
|
|
133
156
|
}
|
|
134
157
|
ptr = realloc(ptr, len, len = offset + arg.length * 3, 1) >>> 0;
|
|
135
158
|
const view = getUint8ArrayMemory0().subarray(ptr + offset, ptr + len);
|
|
136
|
-
const ret =
|
|
159
|
+
const ret = cachedTextEncoder.encodeInto(arg, view);
|
|
137
160
|
|
|
138
161
|
offset += ret.written;
|
|
139
162
|
ptr = realloc(ptr, len, offset, 1) >>> 0;
|
|
@@ -157,24 +180,6 @@ function getDataViewMemory0() {
|
|
|
157
180
|
return cachedDataViewMemory0;
|
|
158
181
|
}
|
|
159
182
|
|
|
160
|
-
const lTextDecoder = typeof TextDecoder === 'undefined'
|
|
161
|
-
? (0, module.require)('util').TextDecoder
|
|
162
|
-
: TextDecoder;
|
|
163
|
-
|
|
164
|
-
let cachedTextDecoder = new lTextDecoder('utf-8', {
|
|
165
|
-
ignoreBOM: true,
|
|
166
|
-
fatal: true,
|
|
167
|
-
});
|
|
168
|
-
|
|
169
|
-
cachedTextDecoder.decode();
|
|
170
|
-
|
|
171
|
-
function getStringFromWasm0(ptr, len) {
|
|
172
|
-
ptr = ptr >>> 0;
|
|
173
|
-
return cachedTextDecoder.decode(
|
|
174
|
-
getUint8ArrayMemory0().subarray(ptr, ptr + len),
|
|
175
|
-
);
|
|
176
|
-
}
|
|
177
|
-
|
|
178
183
|
function passArray8ToWasm0(arg, malloc) {
|
|
179
184
|
const ptr = malloc(arg.length * 1, 1) >>> 0;
|
|
180
185
|
getUint8ArrayMemory0().set(arg, ptr / 1);
|
|
@@ -193,13 +198,27 @@ export function parse_content(xml_bytes) {
|
|
|
193
198
|
}
|
|
194
199
|
|
|
195
200
|
/**
|
|
196
|
-
* @param {Uint8Array}
|
|
201
|
+
* @param {Uint8Array} zip_data
|
|
197
202
|
* @returns {any}
|
|
198
203
|
*/
|
|
199
|
-
export function
|
|
200
|
-
const ptr0 = passArray8ToWasm0(
|
|
204
|
+
export function unzip(zip_data) {
|
|
205
|
+
const ptr0 = passArray8ToWasm0(zip_data, wasm.__wbindgen_malloc);
|
|
201
206
|
const len0 = WASM_VECTOR_LEN;
|
|
202
|
-
const ret = wasm.
|
|
207
|
+
const ret = wasm.unzip(ptr0, len0);
|
|
208
|
+
return ret;
|
|
209
|
+
}
|
|
210
|
+
|
|
211
|
+
export function init_debug() {
|
|
212
|
+
wasm.init_debug();
|
|
213
|
+
}
|
|
214
|
+
|
|
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);
|
|
203
222
|
return ret;
|
|
204
223
|
}
|
|
205
224
|
|
|
@@ -221,23 +240,13 @@ export function echo(zip_data) {
|
|
|
221
240
|
}
|
|
222
241
|
|
|
223
242
|
/**
|
|
224
|
-
* @param {
|
|
225
|
-
* @param {number} b
|
|
226
|
-
* @returns {number}
|
|
227
|
-
*/
|
|
228
|
-
export function add(a, b) {
|
|
229
|
-
const ret = wasm.add(a, b);
|
|
230
|
-
return ret;
|
|
231
|
-
}
|
|
232
|
-
|
|
233
|
-
/**
|
|
234
|
-
* @param {Uint8Array} zip_data
|
|
243
|
+
* @param {Uint8Array} xml_bytes
|
|
235
244
|
* @returns {any}
|
|
236
245
|
*/
|
|
237
|
-
export function
|
|
238
|
-
const ptr0 = passArray8ToWasm0(
|
|
246
|
+
export function parse_styles(xml_bytes) {
|
|
247
|
+
const ptr0 = passArray8ToWasm0(xml_bytes, wasm.__wbindgen_malloc);
|
|
239
248
|
const len0 = WASM_VECTOR_LEN;
|
|
240
|
-
const ret = wasm.
|
|
249
|
+
const ret = wasm.parse_styles(ptr0, len0);
|
|
241
250
|
return ret;
|
|
242
251
|
}
|
|
243
252
|
|
|
@@ -288,42 +297,86 @@ export class Greeter {
|
|
|
288
297
|
}
|
|
289
298
|
}
|
|
290
299
|
}
|
|
300
|
+
if (Symbol.dispose) Greeter.prototype[Symbol.dispose] = Greeter.prototype.free;
|
|
291
301
|
|
|
292
|
-
export function
|
|
302
|
+
export function __wbg_Error_e83987f665cf5504(arg0, arg1) {
|
|
303
|
+
const ret = Error(getStringFromWasm0(arg0, arg1));
|
|
304
|
+
return ret;
|
|
305
|
+
}
|
|
306
|
+
|
|
307
|
+
export function __wbg_Number_bb48ca12f395cd08(arg0) {
|
|
308
|
+
const ret = Number(arg0);
|
|
309
|
+
return ret;
|
|
310
|
+
}
|
|
311
|
+
|
|
312
|
+
export function __wbg___wbindgen_debug_string_df47ffb5e35e6763(arg0, arg1) {
|
|
313
|
+
const ret = debugString(arg1);
|
|
314
|
+
const ptr1 = passStringToWasm0(
|
|
315
|
+
ret,
|
|
316
|
+
wasm.__wbindgen_malloc,
|
|
317
|
+
wasm.__wbindgen_realloc,
|
|
318
|
+
);
|
|
319
|
+
const len1 = WASM_VECTOR_LEN;
|
|
320
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
|
|
321
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
|
|
322
|
+
}
|
|
323
|
+
|
|
324
|
+
export function __wbg___wbindgen_is_string_fbb76cb2940daafd(arg0) {
|
|
325
|
+
const ret = typeof arg0 === 'string';
|
|
326
|
+
return ret;
|
|
327
|
+
}
|
|
328
|
+
|
|
329
|
+
export function __wbg___wbindgen_throw_b855445ff6a94295(arg0, arg1) {
|
|
330
|
+
throw new Error(getStringFromWasm0(arg0, arg1));
|
|
331
|
+
}
|
|
332
|
+
|
|
333
|
+
export function __wbg_error_7534b8e9a36f1ab4(arg0, arg1) {
|
|
334
|
+
let deferred0_0;
|
|
335
|
+
let deferred0_1;
|
|
336
|
+
try {
|
|
337
|
+
deferred0_0 = arg0;
|
|
338
|
+
deferred0_1 = arg1;
|
|
339
|
+
console.error(getStringFromWasm0(arg0, arg1));
|
|
340
|
+
} finally {
|
|
341
|
+
wasm.__wbindgen_free(deferred0_0, deferred0_1, 1);
|
|
342
|
+
}
|
|
343
|
+
}
|
|
344
|
+
|
|
345
|
+
export function __wbg_new_1acc0b6eea89d040() {
|
|
293
346
|
const ret = new Object();
|
|
294
347
|
return ret;
|
|
295
348
|
}
|
|
296
349
|
|
|
297
|
-
export function
|
|
350
|
+
export function __wbg_new_68651c719dcda04e() {
|
|
298
351
|
const ret = new Map();
|
|
299
352
|
return ret;
|
|
300
353
|
}
|
|
301
354
|
|
|
302
|
-
export function
|
|
303
|
-
const ret = new
|
|
355
|
+
export function __wbg_new_8a6f238a6ece86ea() {
|
|
356
|
+
const ret = new Error();
|
|
304
357
|
return ret;
|
|
305
358
|
}
|
|
306
359
|
|
|
307
|
-
export function
|
|
308
|
-
|
|
360
|
+
export function __wbg_new_e17d9f43105b08be() {
|
|
361
|
+
const ret = new Array();
|
|
362
|
+
return ret;
|
|
309
363
|
}
|
|
310
364
|
|
|
311
365
|
export function __wbg_set_3f1d0b984ed272ed(arg0, arg1, arg2) {
|
|
312
366
|
arg0[arg1] = arg2;
|
|
313
367
|
}
|
|
314
368
|
|
|
315
|
-
export function
|
|
369
|
+
export function __wbg_set_907fb406c34a251d(arg0, arg1, arg2) {
|
|
316
370
|
const ret = arg0.set(arg1, arg2);
|
|
317
371
|
return ret;
|
|
318
372
|
}
|
|
319
373
|
|
|
320
|
-
export function
|
|
321
|
-
|
|
322
|
-
return ret;
|
|
374
|
+
export function __wbg_set_c213c871859d6500(arg0, arg1, arg2) {
|
|
375
|
+
arg0[arg1 >>> 0] = arg2;
|
|
323
376
|
}
|
|
324
377
|
|
|
325
|
-
export function
|
|
326
|
-
const ret =
|
|
378
|
+
export function __wbg_stack_0ed75d68575b0f3c(arg0, arg1) {
|
|
379
|
+
const ret = arg1.stack;
|
|
327
380
|
const ptr1 = passStringToWasm0(
|
|
328
381
|
ret,
|
|
329
382
|
wasm.__wbindgen_malloc,
|
|
@@ -334,13 +387,20 @@ export function __wbindgen_debug_string(arg0, arg1) {
|
|
|
334
387
|
getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
|
|
335
388
|
}
|
|
336
389
|
|
|
337
|
-
export function
|
|
338
|
-
|
|
390
|
+
export function __wbindgen_cast_2241b6af4c4b2941(arg0, arg1) {
|
|
391
|
+
// Cast intrinsic for `Ref(String) -> Externref`.
|
|
392
|
+
const ret = getStringFromWasm0(arg0, arg1);
|
|
393
|
+
return ret;
|
|
394
|
+
}
|
|
395
|
+
|
|
396
|
+
export function __wbindgen_cast_d6cd19b81560fd6e(arg0) {
|
|
397
|
+
// Cast intrinsic for `F64 -> Externref`.
|
|
398
|
+
const ret = arg0;
|
|
339
399
|
return ret;
|
|
340
400
|
}
|
|
341
401
|
|
|
342
402
|
export function __wbindgen_init_externref_table() {
|
|
343
|
-
const table = wasm.
|
|
403
|
+
const table = wasm.__wbindgen_externrefs;
|
|
344
404
|
const offset = table.grow(4);
|
|
345
405
|
table.set(0, undefined);
|
|
346
406
|
table.set(offset + 0, undefined);
|
|
@@ -348,22 +408,3 @@ export function __wbindgen_init_externref_table() {
|
|
|
348
408
|
table.set(offset + 2, true);
|
|
349
409
|
table.set(offset + 3, false);
|
|
350
410
|
}
|
|
351
|
-
|
|
352
|
-
export function __wbindgen_is_string(arg0) {
|
|
353
|
-
const ret = typeof arg0 === 'string';
|
|
354
|
-
return ret;
|
|
355
|
-
}
|
|
356
|
-
|
|
357
|
-
export function __wbindgen_number_new(arg0) {
|
|
358
|
-
const ret = arg0;
|
|
359
|
-
return ret;
|
|
360
|
-
}
|
|
361
|
-
|
|
362
|
-
export function __wbindgen_string_new(arg0, arg1) {
|
|
363
|
-
const ret = getStringFromWasm0(arg0, arg1);
|
|
364
|
-
return ret;
|
|
365
|
-
}
|
|
366
|
-
|
|
367
|
-
export function __wbindgen_throw(arg0, arg1) {
|
|
368
|
-
throw new Error(getStringFromWasm0(arg0, arg1));
|
|
369
|
-
}
|
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:
|
|
7
|
+
// source-hash: fb9a97cb16901678b9b7f2462418503de3bd0fe0
|
|
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
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
// @generated file from wasmbuild -- do not edit
|
|
2
|
+
// deno-lint-ignore-file
|
|
3
|
+
// deno-fmt-ignore-file
|
|
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
|
+
export class Greeter {
|
|
12
|
+
free(): void;
|
|
13
|
+
[Symbol.dispose](): void;
|
|
14
|
+
constructor(name: string);
|
|
15
|
+
greet(): string;
|
|
16
|
+
}
|
|
@@ -0,0 +1,410 @@
|
|
|
1
|
+
// @generated file from wasmbuild -- do not edit
|
|
2
|
+
// @ts-nocheck: generated
|
|
3
|
+
// deno-lint-ignore-file
|
|
4
|
+
// deno-fmt-ignore-file
|
|
5
|
+
|
|
6
|
+
let wasm;
|
|
7
|
+
export function __wbg_set_wasm(val) {
|
|
8
|
+
wasm = val;
|
|
9
|
+
}
|
|
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
|
+
function debugString(val) {
|
|
52
|
+
// primitive types
|
|
53
|
+
const type = typeof val;
|
|
54
|
+
if (type == 'number' || type == 'boolean' || val == null) {
|
|
55
|
+
return `${val}`;
|
|
56
|
+
}
|
|
57
|
+
if (type == 'string') {
|
|
58
|
+
return `"${val}"`;
|
|
59
|
+
}
|
|
60
|
+
if (type == 'symbol') {
|
|
61
|
+
const description = val.description;
|
|
62
|
+
if (description == null) {
|
|
63
|
+
return 'Symbol';
|
|
64
|
+
} else {
|
|
65
|
+
return `Symbol(${description})`;
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
if (type == 'function') {
|
|
69
|
+
const name = val.name;
|
|
70
|
+
if (typeof name == 'string' && name.length > 0) {
|
|
71
|
+
return `Function(${name})`;
|
|
72
|
+
} else {
|
|
73
|
+
return 'Function';
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
// objects
|
|
77
|
+
if (Array.isArray(val)) {
|
|
78
|
+
const length = val.length;
|
|
79
|
+
let debug = '[';
|
|
80
|
+
if (length > 0) {
|
|
81
|
+
debug += debugString(val[0]);
|
|
82
|
+
}
|
|
83
|
+
for (let i = 1; i < length; i++) {
|
|
84
|
+
debug += ', ' + debugString(val[i]);
|
|
85
|
+
}
|
|
86
|
+
debug += ']';
|
|
87
|
+
return debug;
|
|
88
|
+
}
|
|
89
|
+
// Test for built-in
|
|
90
|
+
const builtInMatches = /\[object ([^\]]+)\]/.exec(toString.call(val));
|
|
91
|
+
let className;
|
|
92
|
+
if (builtInMatches && builtInMatches.length > 1) {
|
|
93
|
+
className = builtInMatches[1];
|
|
94
|
+
} else {
|
|
95
|
+
// Failed to match the standard '[object ClassName]'
|
|
96
|
+
return toString.call(val);
|
|
97
|
+
}
|
|
98
|
+
if (className == 'Object') {
|
|
99
|
+
// we're a user defined class or Object
|
|
100
|
+
// JSON.stringify avoids problems with cycles, and is generally much
|
|
101
|
+
// easier than looping through ownProperties of `val`.
|
|
102
|
+
try {
|
|
103
|
+
return 'Object(' + JSON.stringify(val) + ')';
|
|
104
|
+
} catch (_) {
|
|
105
|
+
return 'Object';
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
// errors
|
|
109
|
+
if (val instanceof Error) {
|
|
110
|
+
return `${val.name}: ${val.message}\n${val.stack}`;
|
|
111
|
+
}
|
|
112
|
+
// TODO we could test for more things here, like `Set`s and `Map`s.
|
|
113
|
+
return className;
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
let WASM_VECTOR_LEN = 0;
|
|
117
|
+
|
|
118
|
+
const cachedTextEncoder = new TextEncoder();
|
|
119
|
+
|
|
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
|
+
};
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
function passStringToWasm0(arg, malloc, realloc) {
|
|
132
|
+
if (realloc === undefined) {
|
|
133
|
+
const buf = cachedTextEncoder.encode(arg);
|
|
134
|
+
const ptr = malloc(buf.length, 1) >>> 0;
|
|
135
|
+
getUint8ArrayMemory0().subarray(ptr, ptr + buf.length).set(buf);
|
|
136
|
+
WASM_VECTOR_LEN = buf.length;
|
|
137
|
+
return ptr;
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
let len = arg.length;
|
|
141
|
+
let ptr = malloc(len, 1) >>> 0;
|
|
142
|
+
|
|
143
|
+
const mem = getUint8ArrayMemory0();
|
|
144
|
+
|
|
145
|
+
let offset = 0;
|
|
146
|
+
|
|
147
|
+
for (; offset < len; offset++) {
|
|
148
|
+
const code = arg.charCodeAt(offset);
|
|
149
|
+
if (code > 0x7F) break;
|
|
150
|
+
mem[ptr + offset] = code;
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
if (offset !== len) {
|
|
154
|
+
if (offset !== 0) {
|
|
155
|
+
arg = arg.slice(offset);
|
|
156
|
+
}
|
|
157
|
+
ptr = realloc(ptr, len, len = offset + arg.length * 3, 1) >>> 0;
|
|
158
|
+
const view = getUint8ArrayMemory0().subarray(ptr + offset, ptr + len);
|
|
159
|
+
const ret = cachedTextEncoder.encodeInto(arg, view);
|
|
160
|
+
|
|
161
|
+
offset += ret.written;
|
|
162
|
+
ptr = realloc(ptr, len, offset, 1) >>> 0;
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
WASM_VECTOR_LEN = offset;
|
|
166
|
+
return ptr;
|
|
167
|
+
}
|
|
168
|
+
|
|
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);
|
|
179
|
+
}
|
|
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;
|
|
213
|
+
}
|
|
214
|
+
|
|
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
|
+
}
|
|
225
|
+
|
|
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;
|
|
234
|
+
}
|
|
235
|
+
|
|
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
|
+
}
|
|
252
|
+
|
|
253
|
+
const GreeterFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
254
|
+
? { register: () => {}, unregister: () => {} }
|
|
255
|
+
: new FinalizationRegistry((ptr) => wasm.__wbg_greeter_free(ptr >>> 0, 1));
|
|
256
|
+
|
|
257
|
+
export class Greeter {
|
|
258
|
+
__destroy_into_raw() {
|
|
259
|
+
const ptr = this.__wbg_ptr;
|
|
260
|
+
this.__wbg_ptr = 0;
|
|
261
|
+
GreeterFinalization.unregister(this);
|
|
262
|
+
return ptr;
|
|
263
|
+
}
|
|
264
|
+
|
|
265
|
+
free() {
|
|
266
|
+
const ptr = this.__destroy_into_raw();
|
|
267
|
+
wasm.__wbg_greeter_free(ptr, 0);
|
|
268
|
+
}
|
|
269
|
+
/**
|
|
270
|
+
* @param {string} name
|
|
271
|
+
*/
|
|
272
|
+
constructor(name) {
|
|
273
|
+
const ptr0 = passStringToWasm0(
|
|
274
|
+
name,
|
|
275
|
+
wasm.__wbindgen_malloc,
|
|
276
|
+
wasm.__wbindgen_realloc,
|
|
277
|
+
);
|
|
278
|
+
const len0 = WASM_VECTOR_LEN;
|
|
279
|
+
const ret = wasm.greeter_new(ptr0, len0);
|
|
280
|
+
this.__wbg_ptr = ret >>> 0;
|
|
281
|
+
GreeterFinalization.register(this, this.__wbg_ptr, this);
|
|
282
|
+
return this;
|
|
283
|
+
}
|
|
284
|
+
/**
|
|
285
|
+
* @returns {string}
|
|
286
|
+
*/
|
|
287
|
+
greet() {
|
|
288
|
+
let deferred1_0;
|
|
289
|
+
let deferred1_1;
|
|
290
|
+
try {
|
|
291
|
+
const ret = wasm.greeter_greet(this.__wbg_ptr);
|
|
292
|
+
deferred1_0 = ret[0];
|
|
293
|
+
deferred1_1 = ret[1];
|
|
294
|
+
return getStringFromWasm0(ret[0], ret[1]);
|
|
295
|
+
} finally {
|
|
296
|
+
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
|
297
|
+
}
|
|
298
|
+
}
|
|
299
|
+
}
|
|
300
|
+
if (Symbol.dispose) Greeter.prototype[Symbol.dispose] = Greeter.prototype.free;
|
|
301
|
+
|
|
302
|
+
export function __wbg_Error_e83987f665cf5504(arg0, arg1) {
|
|
303
|
+
const ret = Error(getStringFromWasm0(arg0, arg1));
|
|
304
|
+
return ret;
|
|
305
|
+
}
|
|
306
|
+
|
|
307
|
+
export function __wbg_Number_bb48ca12f395cd08(arg0) {
|
|
308
|
+
const ret = Number(arg0);
|
|
309
|
+
return ret;
|
|
310
|
+
}
|
|
311
|
+
|
|
312
|
+
export function __wbg___wbindgen_debug_string_df47ffb5e35e6763(arg0, arg1) {
|
|
313
|
+
const ret = debugString(arg1);
|
|
314
|
+
const ptr1 = passStringToWasm0(
|
|
315
|
+
ret,
|
|
316
|
+
wasm.__wbindgen_malloc,
|
|
317
|
+
wasm.__wbindgen_realloc,
|
|
318
|
+
);
|
|
319
|
+
const len1 = WASM_VECTOR_LEN;
|
|
320
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
|
|
321
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
|
|
322
|
+
}
|
|
323
|
+
|
|
324
|
+
export function __wbg___wbindgen_is_string_fbb76cb2940daafd(arg0) {
|
|
325
|
+
const ret = typeof arg0 === 'string';
|
|
326
|
+
return ret;
|
|
327
|
+
}
|
|
328
|
+
|
|
329
|
+
export function __wbg___wbindgen_throw_b855445ff6a94295(arg0, arg1) {
|
|
330
|
+
throw new Error(getStringFromWasm0(arg0, arg1));
|
|
331
|
+
}
|
|
332
|
+
|
|
333
|
+
export function __wbg_error_7534b8e9a36f1ab4(arg0, arg1) {
|
|
334
|
+
let deferred0_0;
|
|
335
|
+
let deferred0_1;
|
|
336
|
+
try {
|
|
337
|
+
deferred0_0 = arg0;
|
|
338
|
+
deferred0_1 = arg1;
|
|
339
|
+
console.error(getStringFromWasm0(arg0, arg1));
|
|
340
|
+
} finally {
|
|
341
|
+
wasm.__wbindgen_free(deferred0_0, deferred0_1, 1);
|
|
342
|
+
}
|
|
343
|
+
}
|
|
344
|
+
|
|
345
|
+
export function __wbg_new_1acc0b6eea89d040() {
|
|
346
|
+
const ret = new Object();
|
|
347
|
+
return ret;
|
|
348
|
+
}
|
|
349
|
+
|
|
350
|
+
export function __wbg_new_68651c719dcda04e() {
|
|
351
|
+
const ret = new Map();
|
|
352
|
+
return ret;
|
|
353
|
+
}
|
|
354
|
+
|
|
355
|
+
export function __wbg_new_8a6f238a6ece86ea() {
|
|
356
|
+
const ret = new Error();
|
|
357
|
+
return ret;
|
|
358
|
+
}
|
|
359
|
+
|
|
360
|
+
export function __wbg_new_e17d9f43105b08be() {
|
|
361
|
+
const ret = new Array();
|
|
362
|
+
return ret;
|
|
363
|
+
}
|
|
364
|
+
|
|
365
|
+
export function __wbg_set_3f1d0b984ed272ed(arg0, arg1, arg2) {
|
|
366
|
+
arg0[arg1] = arg2;
|
|
367
|
+
}
|
|
368
|
+
|
|
369
|
+
export function __wbg_set_907fb406c34a251d(arg0, arg1, arg2) {
|
|
370
|
+
const ret = arg0.set(arg1, arg2);
|
|
371
|
+
return ret;
|
|
372
|
+
}
|
|
373
|
+
|
|
374
|
+
export function __wbg_set_c213c871859d6500(arg0, arg1, arg2) {
|
|
375
|
+
arg0[arg1 >>> 0] = arg2;
|
|
376
|
+
}
|
|
377
|
+
|
|
378
|
+
export function __wbg_stack_0ed75d68575b0f3c(arg0, arg1) {
|
|
379
|
+
const ret = arg1.stack;
|
|
380
|
+
const ptr1 = passStringToWasm0(
|
|
381
|
+
ret,
|
|
382
|
+
wasm.__wbindgen_malloc,
|
|
383
|
+
wasm.__wbindgen_realloc,
|
|
384
|
+
);
|
|
385
|
+
const len1 = WASM_VECTOR_LEN;
|
|
386
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
|
|
387
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
|
|
388
|
+
}
|
|
389
|
+
|
|
390
|
+
export function __wbindgen_cast_2241b6af4c4b2941(arg0, arg1) {
|
|
391
|
+
// Cast intrinsic for `Ref(String) -> Externref`.
|
|
392
|
+
const ret = getStringFromWasm0(arg0, arg1);
|
|
393
|
+
return ret;
|
|
394
|
+
}
|
|
395
|
+
|
|
396
|
+
export function __wbindgen_cast_d6cd19b81560fd6e(arg0) {
|
|
397
|
+
// Cast intrinsic for `F64 -> Externref`.
|
|
398
|
+
const ret = arg0;
|
|
399
|
+
return ret;
|
|
400
|
+
}
|
|
401
|
+
|
|
402
|
+
export function __wbindgen_init_externref_table() {
|
|
403
|
+
const table = wasm.__wbindgen_externrefs;
|
|
404
|
+
const offset = table.grow(4);
|
|
405
|
+
table.set(0, undefined);
|
|
406
|
+
table.set(offset + 0, undefined);
|
|
407
|
+
table.set(offset + 1, null);
|
|
408
|
+
table.set(offset + 2, true);
|
|
409
|
+
table.set(offset + 3, false);
|
|
410
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
// @generated file from wasmbuild -- do not edit
|
|
2
|
+
// @ts-nocheck: generated
|
|
3
|
+
// deno-lint-ignore-file
|
|
4
|
+
// deno-fmt-ignore-file
|
|
5
|
+
// @ts-self-types="./rs_lib.d.ts"
|
|
6
|
+
|
|
7
|
+
// source-hash: fb9a97cb16901678b9b7f2462418503de3bd0fe0
|
|
8
|
+
import * as wasm from "./rs_lib.wasm";
|
|
9
|
+
export * from "./rs_lib.internal.js";
|
|
10
|
+
import { __wbg_set_wasm } from "./rs_lib.internal.js";
|
|
11
|
+
__wbg_set_wasm(wasm);
|
|
12
|
+
wasm.__wbindgen_start();
|
|
Binary file
|
package/package.json
CHANGED
|
@@ -3,13 +3,17 @@
|
|
|
3
3
|
"type": "module",
|
|
4
4
|
"main": "./lib/rs_lib.js",
|
|
5
5
|
"files": [
|
|
6
|
-
"lib/"
|
|
6
|
+
"lib/",
|
|
7
|
+
"lib-debug/"
|
|
7
8
|
],
|
|
8
9
|
"exports": {
|
|
9
10
|
".": {
|
|
10
11
|
"import": "./lib/rs_lib.js"
|
|
12
|
+
},
|
|
13
|
+
"./debug": {
|
|
14
|
+
"import": "./lib-debug/rs_lib.js"
|
|
11
15
|
}
|
|
12
16
|
},
|
|
13
|
-
"version": "0.4.
|
|
17
|
+
"version": "0.4.30",
|
|
14
18
|
"license": "MIT"
|
|
15
19
|
}
|