@diodeinc/pcb-zen-wasm 0.3.70 → 0.3.72
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 +1 -1
- package/pcb_zen_wasm.d.ts +27 -24
- package/pcb_zen_wasm.js +207 -206
- package/pcb_zen_wasm_bg.wasm +0 -0
package/package.json
CHANGED
package/pcb_zen_wasm.d.ts
CHANGED
|
@@ -1,42 +1,45 @@
|
|
|
1
1
|
/* tslint:disable */
|
|
2
2
|
/* eslint-disable */
|
|
3
|
-
|
|
3
|
+
|
|
4
4
|
/**
|
|
5
5
|
* Evaluate a Zener module from an in-memory source bundle (WASM binding).
|
|
6
6
|
*/
|
|
7
7
|
export function evaluate(bundle_bytes: Uint8Array, main_file: string, inputs_json: string): any;
|
|
8
8
|
|
|
9
|
+
export function start(): void;
|
|
10
|
+
|
|
9
11
|
export type InitInput = RequestInfo | URL | Response | BufferSource | WebAssembly.Module;
|
|
10
12
|
|
|
11
13
|
export interface InitOutput {
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
14
|
+
readonly memory: WebAssembly.Memory;
|
|
15
|
+
readonly evaluate: (a: number, b: number, c: number, d: number, e: number, f: number) => [number, number, number];
|
|
16
|
+
readonly start: () => void;
|
|
17
|
+
readonly __wbindgen_malloc: (a: number, b: number) => number;
|
|
18
|
+
readonly __wbindgen_realloc: (a: number, b: number, c: number, d: number) => number;
|
|
19
|
+
readonly __wbindgen_free: (a: number, b: number, c: number) => void;
|
|
20
|
+
readonly __wbindgen_externrefs: WebAssembly.Table;
|
|
21
|
+
readonly __externref_table_dealloc: (a: number) => void;
|
|
22
|
+
readonly __wbindgen_start: () => void;
|
|
21
23
|
}
|
|
22
24
|
|
|
23
25
|
export type SyncInitInput = BufferSource | WebAssembly.Module;
|
|
26
|
+
|
|
24
27
|
/**
|
|
25
|
-
* Instantiates the given `module`, which can either be bytes or
|
|
26
|
-
* a precompiled `WebAssembly.Module`.
|
|
27
|
-
*
|
|
28
|
-
* @param {{ module: SyncInitInput }} module - Passing `SyncInitInput` directly is deprecated.
|
|
29
|
-
*
|
|
30
|
-
* @returns {InitOutput}
|
|
31
|
-
*/
|
|
28
|
+
* Instantiates the given `module`, which can either be bytes or
|
|
29
|
+
* a precompiled `WebAssembly.Module`.
|
|
30
|
+
*
|
|
31
|
+
* @param {{ module: SyncInitInput }} module - Passing `SyncInitInput` directly is deprecated.
|
|
32
|
+
*
|
|
33
|
+
* @returns {InitOutput}
|
|
34
|
+
*/
|
|
32
35
|
export function initSync(module: { module: SyncInitInput } | SyncInitInput): InitOutput;
|
|
33
36
|
|
|
34
37
|
/**
|
|
35
|
-
* If `module_or_path` is {RequestInfo} or {URL}, makes a request and
|
|
36
|
-
* for everything else, calls `WebAssembly.instantiate` directly.
|
|
37
|
-
*
|
|
38
|
-
* @param {{ module_or_path: InitInput | Promise<InitInput> }} module_or_path - Passing `InitInput` directly is deprecated.
|
|
39
|
-
*
|
|
40
|
-
* @returns {Promise<InitOutput>}
|
|
41
|
-
*/
|
|
38
|
+
* If `module_or_path` is {RequestInfo} or {URL}, makes a request and
|
|
39
|
+
* for everything else, calls `WebAssembly.instantiate` directly.
|
|
40
|
+
*
|
|
41
|
+
* @param {{ module_or_path: InitInput | Promise<InitInput> }} module_or_path - Passing `InitInput` directly is deprecated.
|
|
42
|
+
*
|
|
43
|
+
* @returns {Promise<InitOutput>}
|
|
44
|
+
*/
|
|
42
45
|
export default function __wbg_init (module_or_path?: { module_or_path: InitInput | Promise<InitInput> } | InitInput | Promise<InitInput>): Promise<InitOutput>;
|
package/pcb_zen_wasm.js
CHANGED
|
@@ -1,9 +1,159 @@
|
|
|
1
|
-
|
|
1
|
+
/* @ts-self-types="./pcb_zen_wasm.d.ts" */
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
/**
|
|
4
|
+
* Evaluate a Zener module from an in-memory source bundle (WASM binding).
|
|
5
|
+
* @param {Uint8Array} bundle_bytes
|
|
6
|
+
* @param {string} main_file
|
|
7
|
+
* @param {string} inputs_json
|
|
8
|
+
* @returns {any}
|
|
9
|
+
*/
|
|
10
|
+
export function evaluate(bundle_bytes, main_file, inputs_json) {
|
|
11
|
+
const ptr0 = passArray8ToWasm0(bundle_bytes, wasm.__wbindgen_malloc);
|
|
12
|
+
const len0 = WASM_VECTOR_LEN;
|
|
13
|
+
const ptr1 = passStringToWasm0(main_file, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
14
|
+
const len1 = WASM_VECTOR_LEN;
|
|
15
|
+
const ptr2 = passStringToWasm0(inputs_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
16
|
+
const len2 = WASM_VECTOR_LEN;
|
|
17
|
+
const ret = wasm.evaluate(ptr0, len0, ptr1, len1, ptr2, len2);
|
|
18
|
+
if (ret[2]) {
|
|
19
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
20
|
+
}
|
|
21
|
+
return takeFromExternrefTable0(ret[0]);
|
|
22
|
+
}
|
|
4
23
|
|
|
5
|
-
|
|
24
|
+
export function start() {
|
|
25
|
+
wasm.start();
|
|
26
|
+
}
|
|
27
|
+
function __wbg_get_imports() {
|
|
28
|
+
const import0 = {
|
|
29
|
+
__proto__: null,
|
|
30
|
+
__wbg_Error_960c155d3d49e4c2: function(arg0, arg1) {
|
|
31
|
+
const ret = Error(getStringFromWasm0(arg0, arg1));
|
|
32
|
+
return ret;
|
|
33
|
+
},
|
|
34
|
+
__wbg_String_8564e559799eccda: function(arg0, arg1) {
|
|
35
|
+
const ret = String(arg1);
|
|
36
|
+
const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
37
|
+
const len1 = WASM_VECTOR_LEN;
|
|
38
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
|
|
39
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
|
|
40
|
+
},
|
|
41
|
+
__wbg___wbindgen_is_string_6df3bf7ef1164ed3: function(arg0) {
|
|
42
|
+
const ret = typeof(arg0) === 'string';
|
|
43
|
+
return ret;
|
|
44
|
+
},
|
|
45
|
+
__wbg___wbindgen_throw_6b64449b9b9ed33c: function(arg0, arg1) {
|
|
46
|
+
throw new Error(getStringFromWasm0(arg0, arg1));
|
|
47
|
+
},
|
|
48
|
+
__wbg_debug_c014a160490283dc: function(arg0) {
|
|
49
|
+
console.debug(arg0);
|
|
50
|
+
},
|
|
51
|
+
__wbg_error_2001591ad2463697: function(arg0) {
|
|
52
|
+
console.error(arg0);
|
|
53
|
+
},
|
|
54
|
+
__wbg_error_a6fa202b58aa1cd3: function(arg0, arg1) {
|
|
55
|
+
let deferred0_0;
|
|
56
|
+
let deferred0_1;
|
|
57
|
+
try {
|
|
58
|
+
deferred0_0 = arg0;
|
|
59
|
+
deferred0_1 = arg1;
|
|
60
|
+
console.error(getStringFromWasm0(arg0, arg1));
|
|
61
|
+
} finally {
|
|
62
|
+
wasm.__wbindgen_free(deferred0_0, deferred0_1, 1);
|
|
63
|
+
}
|
|
64
|
+
},
|
|
65
|
+
__wbg_info_7479429238bffbce: function(arg0) {
|
|
66
|
+
console.info(arg0);
|
|
67
|
+
},
|
|
68
|
+
__wbg_log_7e1aa9064a1dbdbd: function(arg0) {
|
|
69
|
+
console.log(arg0);
|
|
70
|
+
},
|
|
71
|
+
__wbg_new_227d7c05414eb861: function() {
|
|
72
|
+
const ret = new Error();
|
|
73
|
+
return ret;
|
|
74
|
+
},
|
|
75
|
+
__wbg_new_34d45cc8e36aaead: function() {
|
|
76
|
+
const ret = new Map();
|
|
77
|
+
return ret;
|
|
78
|
+
},
|
|
79
|
+
__wbg_new_682678e2f47e32bc: function() {
|
|
80
|
+
const ret = new Array();
|
|
81
|
+
return ret;
|
|
82
|
+
},
|
|
83
|
+
__wbg_new_aa8d0fa9762c29bd: function() {
|
|
84
|
+
const ret = new Object();
|
|
85
|
+
return ret;
|
|
86
|
+
},
|
|
87
|
+
__wbg_set_3bf1de9fab0cd644: function(arg0, arg1, arg2) {
|
|
88
|
+
arg0[arg1 >>> 0] = arg2;
|
|
89
|
+
},
|
|
90
|
+
__wbg_set_6be42768c690e380: function(arg0, arg1, arg2) {
|
|
91
|
+
arg0[arg1] = arg2;
|
|
92
|
+
},
|
|
93
|
+
__wbg_set_fde2cec06c23692b: function(arg0, arg1, arg2) {
|
|
94
|
+
const ret = arg0.set(arg1, arg2);
|
|
95
|
+
return ret;
|
|
96
|
+
},
|
|
97
|
+
__wbg_stack_3b0d974bbf31e44f: function(arg0, arg1) {
|
|
98
|
+
const ret = arg1.stack;
|
|
99
|
+
const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
100
|
+
const len1 = WASM_VECTOR_LEN;
|
|
101
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
|
|
102
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
|
|
103
|
+
},
|
|
104
|
+
__wbg_warn_3cc416af27dbdc02: function(arg0) {
|
|
105
|
+
console.warn(arg0);
|
|
106
|
+
},
|
|
107
|
+
__wbindgen_cast_0000000000000001: function(arg0) {
|
|
108
|
+
// Cast intrinsic for `F64 -> Externref`.
|
|
109
|
+
const ret = arg0;
|
|
110
|
+
return ret;
|
|
111
|
+
},
|
|
112
|
+
__wbindgen_cast_0000000000000002: function(arg0) {
|
|
113
|
+
// Cast intrinsic for `I64 -> Externref`.
|
|
114
|
+
const ret = arg0;
|
|
115
|
+
return ret;
|
|
116
|
+
},
|
|
117
|
+
__wbindgen_cast_0000000000000003: function(arg0, arg1) {
|
|
118
|
+
// Cast intrinsic for `Ref(String) -> Externref`.
|
|
119
|
+
const ret = getStringFromWasm0(arg0, arg1);
|
|
120
|
+
return ret;
|
|
121
|
+
},
|
|
122
|
+
__wbindgen_cast_0000000000000004: function(arg0) {
|
|
123
|
+
// Cast intrinsic for `U64 -> Externref`.
|
|
124
|
+
const ret = BigInt.asUintN(64, arg0);
|
|
125
|
+
return ret;
|
|
126
|
+
},
|
|
127
|
+
__wbindgen_init_externref_table: function() {
|
|
128
|
+
const table = wasm.__wbindgen_externrefs;
|
|
129
|
+
const offset = table.grow(4);
|
|
130
|
+
table.set(0, undefined);
|
|
131
|
+
table.set(offset + 0, undefined);
|
|
132
|
+
table.set(offset + 1, null);
|
|
133
|
+
table.set(offset + 2, true);
|
|
134
|
+
table.set(offset + 3, false);
|
|
135
|
+
},
|
|
136
|
+
};
|
|
137
|
+
return {
|
|
138
|
+
__proto__: null,
|
|
139
|
+
"./pcb_zen_wasm_bg.js": import0,
|
|
140
|
+
};
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
let cachedDataViewMemory0 = null;
|
|
144
|
+
function getDataViewMemory0() {
|
|
145
|
+
if (cachedDataViewMemory0 === null || cachedDataViewMemory0.buffer.detached === true || (cachedDataViewMemory0.buffer.detached === undefined && cachedDataViewMemory0.buffer !== wasm.memory.buffer)) {
|
|
146
|
+
cachedDataViewMemory0 = new DataView(wasm.memory.buffer);
|
|
147
|
+
}
|
|
148
|
+
return cachedDataViewMemory0;
|
|
149
|
+
}
|
|
6
150
|
|
|
151
|
+
function getStringFromWasm0(ptr, len) {
|
|
152
|
+
ptr = ptr >>> 0;
|
|
153
|
+
return decodeText(ptr, len);
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
let cachedUint8ArrayMemory0 = null;
|
|
7
157
|
function getUint8ArrayMemory0() {
|
|
8
158
|
if (cachedUint8ArrayMemory0 === null || cachedUint8ArrayMemory0.byteLength === 0) {
|
|
9
159
|
cachedUint8ArrayMemory0 = new Uint8Array(wasm.memory.buffer);
|
|
@@ -11,23 +161,14 @@ function getUint8ArrayMemory0() {
|
|
|
11
161
|
return cachedUint8ArrayMemory0;
|
|
12
162
|
}
|
|
13
163
|
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
return
|
|
164
|
+
function passArray8ToWasm0(arg, malloc) {
|
|
165
|
+
const ptr = malloc(arg.length * 1, 1) >>> 0;
|
|
166
|
+
getUint8ArrayMemory0().set(arg, ptr / 1);
|
|
167
|
+
WASM_VECTOR_LEN = arg.length;
|
|
168
|
+
return ptr;
|
|
19
169
|
}
|
|
20
|
-
: function (arg, view) {
|
|
21
|
-
const buf = cachedTextEncoder.encode(arg);
|
|
22
|
-
view.set(buf);
|
|
23
|
-
return {
|
|
24
|
-
read: arg.length,
|
|
25
|
-
written: buf.length
|
|
26
|
-
};
|
|
27
|
-
});
|
|
28
170
|
|
|
29
171
|
function passStringToWasm0(arg, malloc, realloc) {
|
|
30
|
-
|
|
31
172
|
if (realloc === undefined) {
|
|
32
173
|
const buf = cachedTextEncoder.encode(arg);
|
|
33
174
|
const ptr = malloc(buf.length, 1) >>> 0;
|
|
@@ -48,14 +189,13 @@ function passStringToWasm0(arg, malloc, realloc) {
|
|
|
48
189
|
if (code > 0x7F) break;
|
|
49
190
|
mem[ptr + offset] = code;
|
|
50
191
|
}
|
|
51
|
-
|
|
52
192
|
if (offset !== len) {
|
|
53
193
|
if (offset !== 0) {
|
|
54
194
|
arg = arg.slice(offset);
|
|
55
195
|
}
|
|
56
196
|
ptr = realloc(ptr, len, len = offset + arg.length * 3, 1) >>> 0;
|
|
57
197
|
const view = getUint8ArrayMemory0().subarray(ptr + offset, ptr + len);
|
|
58
|
-
const ret =
|
|
198
|
+
const ret = cachedTextEncoder.encodeInto(arg, view);
|
|
59
199
|
|
|
60
200
|
offset += ret.written;
|
|
61
201
|
ptr = realloc(ptr, len, offset, 1) >>> 0;
|
|
@@ -65,59 +205,49 @@ function passStringToWasm0(arg, malloc, realloc) {
|
|
|
65
205
|
return ptr;
|
|
66
206
|
}
|
|
67
207
|
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
cachedDataViewMemory0 = new DataView(wasm.memory.buffer);
|
|
73
|
-
}
|
|
74
|
-
return cachedDataViewMemory0;
|
|
208
|
+
function takeFromExternrefTable0(idx) {
|
|
209
|
+
const value = wasm.__wbindgen_externrefs.get(idx);
|
|
210
|
+
wasm.__externref_table_dealloc(idx);
|
|
211
|
+
return value;
|
|
75
212
|
}
|
|
76
213
|
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
function
|
|
82
|
-
|
|
214
|
+
let cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true, fatal: true });
|
|
215
|
+
cachedTextDecoder.decode();
|
|
216
|
+
const MAX_SAFARI_DECODE_BYTES = 2146435072;
|
|
217
|
+
let numBytesDecoded = 0;
|
|
218
|
+
function decodeText(ptr, len) {
|
|
219
|
+
numBytesDecoded += len;
|
|
220
|
+
if (numBytesDecoded >= MAX_SAFARI_DECODE_BYTES) {
|
|
221
|
+
cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true, fatal: true });
|
|
222
|
+
cachedTextDecoder.decode();
|
|
223
|
+
numBytesDecoded = len;
|
|
224
|
+
}
|
|
83
225
|
return cachedTextDecoder.decode(getUint8ArrayMemory0().subarray(ptr, ptr + len));
|
|
84
226
|
}
|
|
85
227
|
|
|
86
|
-
|
|
87
|
-
wasm.start();
|
|
88
|
-
}
|
|
228
|
+
const cachedTextEncoder = new TextEncoder();
|
|
89
229
|
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
230
|
+
if (!('encodeInto' in cachedTextEncoder)) {
|
|
231
|
+
cachedTextEncoder.encodeInto = function (arg, view) {
|
|
232
|
+
const buf = cachedTextEncoder.encode(arg);
|
|
233
|
+
view.set(buf);
|
|
234
|
+
return {
|
|
235
|
+
read: arg.length,
|
|
236
|
+
written: buf.length
|
|
237
|
+
};
|
|
238
|
+
};
|
|
95
239
|
}
|
|
96
240
|
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
* @returns {any}
|
|
108
|
-
*/
|
|
109
|
-
export function evaluate(bundle_bytes, main_file, inputs_json) {
|
|
110
|
-
const ptr0 = passArray8ToWasm0(bundle_bytes, wasm.__wbindgen_malloc);
|
|
111
|
-
const len0 = WASM_VECTOR_LEN;
|
|
112
|
-
const ptr1 = passStringToWasm0(main_file, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
113
|
-
const len1 = WASM_VECTOR_LEN;
|
|
114
|
-
const ptr2 = passStringToWasm0(inputs_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
115
|
-
const len2 = WASM_VECTOR_LEN;
|
|
116
|
-
const ret = wasm.evaluate(ptr0, len0, ptr1, len1, ptr2, len2);
|
|
117
|
-
if (ret[2]) {
|
|
118
|
-
throw takeFromExternrefTable0(ret[1]);
|
|
119
|
-
}
|
|
120
|
-
return takeFromExternrefTable0(ret[0]);
|
|
241
|
+
let WASM_VECTOR_LEN = 0;
|
|
242
|
+
|
|
243
|
+
let wasmModule, wasm;
|
|
244
|
+
function __wbg_finalize_init(instance, module) {
|
|
245
|
+
wasm = instance.exports;
|
|
246
|
+
wasmModule = module;
|
|
247
|
+
cachedDataViewMemory0 = null;
|
|
248
|
+
cachedUint8ArrayMemory0 = null;
|
|
249
|
+
wasm.__wbindgen_start();
|
|
250
|
+
return wasm;
|
|
121
251
|
}
|
|
122
252
|
|
|
123
253
|
async function __wbg_load(module, imports) {
|
|
@@ -125,162 +255,41 @@ async function __wbg_load(module, imports) {
|
|
|
125
255
|
if (typeof WebAssembly.instantiateStreaming === 'function') {
|
|
126
256
|
try {
|
|
127
257
|
return await WebAssembly.instantiateStreaming(module, imports);
|
|
128
|
-
|
|
129
258
|
} catch (e) {
|
|
130
|
-
|
|
259
|
+
const validResponse = module.ok && expectedResponseType(module.type);
|
|
260
|
+
|
|
261
|
+
if (validResponse && module.headers.get('Content-Type') !== 'application/wasm') {
|
|
131
262
|
console.warn("`WebAssembly.instantiateStreaming` failed because your server does not serve Wasm with `application/wasm` MIME type. Falling back to `WebAssembly.instantiate` which is slower. Original error:\n", e);
|
|
132
263
|
|
|
133
|
-
} else {
|
|
134
|
-
throw e;
|
|
135
|
-
}
|
|
264
|
+
} else { throw e; }
|
|
136
265
|
}
|
|
137
266
|
}
|
|
138
267
|
|
|
139
268
|
const bytes = await module.arrayBuffer();
|
|
140
269
|
return await WebAssembly.instantiate(bytes, imports);
|
|
141
|
-
|
|
142
270
|
} else {
|
|
143
271
|
const instance = await WebAssembly.instantiate(module, imports);
|
|
144
272
|
|
|
145
273
|
if (instance instanceof WebAssembly.Instance) {
|
|
146
274
|
return { instance, module };
|
|
147
|
-
|
|
148
275
|
} else {
|
|
149
276
|
return instance;
|
|
150
277
|
}
|
|
151
278
|
}
|
|
152
|
-
}
|
|
153
279
|
|
|
154
|
-
function
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
imports.wbg.__wbg_String_8f0eb39a4a4c2f66 = function(arg0, arg1) {
|
|
158
|
-
const ret = String(arg1);
|
|
159
|
-
const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
160
|
-
const len1 = WASM_VECTOR_LEN;
|
|
161
|
-
getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
|
|
162
|
-
getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
|
|
163
|
-
};
|
|
164
|
-
imports.wbg.__wbg_debug_3cb59063b29f58c1 = function(arg0) {
|
|
165
|
-
console.debug(arg0);
|
|
166
|
-
};
|
|
167
|
-
imports.wbg.__wbg_error_524f506f44df1645 = function(arg0) {
|
|
168
|
-
console.error(arg0);
|
|
169
|
-
};
|
|
170
|
-
imports.wbg.__wbg_error_7534b8e9a36f1ab4 = function(arg0, arg1) {
|
|
171
|
-
let deferred0_0;
|
|
172
|
-
let deferred0_1;
|
|
173
|
-
try {
|
|
174
|
-
deferred0_0 = arg0;
|
|
175
|
-
deferred0_1 = arg1;
|
|
176
|
-
console.error(getStringFromWasm0(arg0, arg1));
|
|
177
|
-
} finally {
|
|
178
|
-
wasm.__wbindgen_free(deferred0_0, deferred0_1, 1);
|
|
280
|
+
function expectedResponseType(type) {
|
|
281
|
+
switch (type) {
|
|
282
|
+
case 'basic': case 'cors': case 'default': return true;
|
|
179
283
|
}
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
console.info(arg0);
|
|
183
|
-
};
|
|
184
|
-
imports.wbg.__wbg_log_c222819a41e063d3 = function(arg0) {
|
|
185
|
-
console.log(arg0);
|
|
186
|
-
};
|
|
187
|
-
imports.wbg.__wbg_new_405e22f390576ce2 = function() {
|
|
188
|
-
const ret = new Object();
|
|
189
|
-
return ret;
|
|
190
|
-
};
|
|
191
|
-
imports.wbg.__wbg_new_5e0be73521bc8c17 = function() {
|
|
192
|
-
const ret = new Map();
|
|
193
|
-
return ret;
|
|
194
|
-
};
|
|
195
|
-
imports.wbg.__wbg_new_78feb108b6472713 = function() {
|
|
196
|
-
const ret = new Array();
|
|
197
|
-
return ret;
|
|
198
|
-
};
|
|
199
|
-
imports.wbg.__wbg_new_8a6f238a6ece86ea = function() {
|
|
200
|
-
const ret = new Error();
|
|
201
|
-
return ret;
|
|
202
|
-
};
|
|
203
|
-
imports.wbg.__wbg_set_37837023f3d740e8 = function(arg0, arg1, arg2) {
|
|
204
|
-
arg0[arg1 >>> 0] = arg2;
|
|
205
|
-
};
|
|
206
|
-
imports.wbg.__wbg_set_3f1d0b984ed272ed = function(arg0, arg1, arg2) {
|
|
207
|
-
arg0[arg1] = arg2;
|
|
208
|
-
};
|
|
209
|
-
imports.wbg.__wbg_set_8fc6bf8a5b1071d1 = function(arg0, arg1, arg2) {
|
|
210
|
-
const ret = arg0.set(arg1, arg2);
|
|
211
|
-
return ret;
|
|
212
|
-
};
|
|
213
|
-
imports.wbg.__wbg_stack_0ed75d68575b0f3c = function(arg0, arg1) {
|
|
214
|
-
const ret = arg1.stack;
|
|
215
|
-
const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
216
|
-
const len1 = WASM_VECTOR_LEN;
|
|
217
|
-
getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
|
|
218
|
-
getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
|
|
219
|
-
};
|
|
220
|
-
imports.wbg.__wbg_warn_4ca3906c248c47c4 = function(arg0) {
|
|
221
|
-
console.warn(arg0);
|
|
222
|
-
};
|
|
223
|
-
imports.wbg.__wbindgen_bigint_from_i64 = function(arg0) {
|
|
224
|
-
const ret = arg0;
|
|
225
|
-
return ret;
|
|
226
|
-
};
|
|
227
|
-
imports.wbg.__wbindgen_bigint_from_u64 = function(arg0) {
|
|
228
|
-
const ret = BigInt.asUintN(64, arg0);
|
|
229
|
-
return ret;
|
|
230
|
-
};
|
|
231
|
-
imports.wbg.__wbindgen_error_new = function(arg0, arg1) {
|
|
232
|
-
const ret = new Error(getStringFromWasm0(arg0, arg1));
|
|
233
|
-
return ret;
|
|
234
|
-
};
|
|
235
|
-
imports.wbg.__wbindgen_init_externref_table = function() {
|
|
236
|
-
const table = wasm.__wbindgen_export_3;
|
|
237
|
-
const offset = table.grow(4);
|
|
238
|
-
table.set(0, undefined);
|
|
239
|
-
table.set(offset + 0, undefined);
|
|
240
|
-
table.set(offset + 1, null);
|
|
241
|
-
table.set(offset + 2, true);
|
|
242
|
-
table.set(offset + 3, false);
|
|
243
|
-
;
|
|
244
|
-
};
|
|
245
|
-
imports.wbg.__wbindgen_is_string = function(arg0) {
|
|
246
|
-
const ret = typeof(arg0) === 'string';
|
|
247
|
-
return ret;
|
|
248
|
-
};
|
|
249
|
-
imports.wbg.__wbindgen_number_new = function(arg0) {
|
|
250
|
-
const ret = arg0;
|
|
251
|
-
return ret;
|
|
252
|
-
};
|
|
253
|
-
imports.wbg.__wbindgen_string_new = function(arg0, arg1) {
|
|
254
|
-
const ret = getStringFromWasm0(arg0, arg1);
|
|
255
|
-
return ret;
|
|
256
|
-
};
|
|
257
|
-
imports.wbg.__wbindgen_throw = function(arg0, arg1) {
|
|
258
|
-
throw new Error(getStringFromWasm0(arg0, arg1));
|
|
259
|
-
};
|
|
260
|
-
|
|
261
|
-
return imports;
|
|
262
|
-
}
|
|
263
|
-
|
|
264
|
-
function __wbg_init_memory(imports, memory) {
|
|
265
|
-
|
|
266
|
-
}
|
|
267
|
-
|
|
268
|
-
function __wbg_finalize_init(instance, module) {
|
|
269
|
-
wasm = instance.exports;
|
|
270
|
-
__wbg_init.__wbindgen_wasm_module = module;
|
|
271
|
-
cachedDataViewMemory0 = null;
|
|
272
|
-
cachedUint8ArrayMemory0 = null;
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
wasm.__wbindgen_start();
|
|
276
|
-
return wasm;
|
|
284
|
+
return false;
|
|
285
|
+
}
|
|
277
286
|
}
|
|
278
287
|
|
|
279
288
|
function initSync(module) {
|
|
280
289
|
if (wasm !== undefined) return wasm;
|
|
281
290
|
|
|
282
291
|
|
|
283
|
-
if (
|
|
292
|
+
if (module !== undefined) {
|
|
284
293
|
if (Object.getPrototypeOf(module) === Object.prototype) {
|
|
285
294
|
({module} = module)
|
|
286
295
|
} else {
|
|
@@ -289,15 +298,10 @@ function initSync(module) {
|
|
|
289
298
|
}
|
|
290
299
|
|
|
291
300
|
const imports = __wbg_get_imports();
|
|
292
|
-
|
|
293
|
-
__wbg_init_memory(imports);
|
|
294
|
-
|
|
295
301
|
if (!(module instanceof WebAssembly.Module)) {
|
|
296
302
|
module = new WebAssembly.Module(module);
|
|
297
303
|
}
|
|
298
|
-
|
|
299
304
|
const instance = new WebAssembly.Instance(module, imports);
|
|
300
|
-
|
|
301
305
|
return __wbg_finalize_init(instance, module);
|
|
302
306
|
}
|
|
303
307
|
|
|
@@ -305,7 +309,7 @@ async function __wbg_init(module_or_path) {
|
|
|
305
309
|
if (wasm !== undefined) return wasm;
|
|
306
310
|
|
|
307
311
|
|
|
308
|
-
if (
|
|
312
|
+
if (module_or_path !== undefined) {
|
|
309
313
|
if (Object.getPrototypeOf(module_or_path) === Object.prototype) {
|
|
310
314
|
({module_or_path} = module_or_path)
|
|
311
315
|
} else {
|
|
@@ -313,7 +317,7 @@ async function __wbg_init(module_or_path) {
|
|
|
313
317
|
}
|
|
314
318
|
}
|
|
315
319
|
|
|
316
|
-
if (
|
|
320
|
+
if (module_or_path === undefined) {
|
|
317
321
|
module_or_path = new URL('pcb_zen_wasm_bg.wasm', import.meta.url);
|
|
318
322
|
}
|
|
319
323
|
const imports = __wbg_get_imports();
|
|
@@ -322,12 +326,9 @@ async function __wbg_init(module_or_path) {
|
|
|
322
326
|
module_or_path = fetch(module_or_path);
|
|
323
327
|
}
|
|
324
328
|
|
|
325
|
-
__wbg_init_memory(imports);
|
|
326
|
-
|
|
327
329
|
const { instance, module } = await __wbg_load(await module_or_path, imports);
|
|
328
330
|
|
|
329
331
|
return __wbg_finalize_init(instance, module);
|
|
330
332
|
}
|
|
331
333
|
|
|
332
|
-
export { initSync };
|
|
333
|
-
export default __wbg_init;
|
|
334
|
+
export { initSync, __wbg_init as default };
|
package/pcb_zen_wasm_bg.wasm
CHANGED
|
Binary file
|