windmill-parser-wasm-regex 1.385.0
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 +17 -0
- package/windmill_parser_wasm.d.ts +87 -0
- package/windmill_parser_wasm.js +393 -0
- package/windmill_parser_wasm_bg.wasm +0 -0
package/package.json
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "windmill-parser-wasm-regex",
|
|
3
|
+
"collaborators": [
|
|
4
|
+
"Ruben Fiszel <ruben@windmill.dev>"
|
|
5
|
+
],
|
|
6
|
+
"version": "1.385.0",
|
|
7
|
+
"files": [
|
|
8
|
+
"windmill_parser_wasm_bg.wasm",
|
|
9
|
+
"windmill_parser_wasm.js",
|
|
10
|
+
"windmill_parser_wasm.d.ts"
|
|
11
|
+
],
|
|
12
|
+
"module": "windmill_parser_wasm.js",
|
|
13
|
+
"types": "windmill_parser_wasm.d.ts",
|
|
14
|
+
"sideEffects": [
|
|
15
|
+
"./snippets/*"
|
|
16
|
+
]
|
|
17
|
+
}
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
/* tslint:disable */
|
|
2
|
+
/* eslint-disable */
|
|
3
|
+
/**
|
|
4
|
+
* @param {string} code
|
|
5
|
+
* @returns {string}
|
|
6
|
+
*/
|
|
7
|
+
export function parse_bash(code: string): string;
|
|
8
|
+
/**
|
|
9
|
+
* @param {string} code
|
|
10
|
+
* @returns {string}
|
|
11
|
+
*/
|
|
12
|
+
export function parse_powershell(code: string): string;
|
|
13
|
+
/**
|
|
14
|
+
* @param {string} code
|
|
15
|
+
* @returns {string}
|
|
16
|
+
*/
|
|
17
|
+
export function parse_sql(code: string): string;
|
|
18
|
+
/**
|
|
19
|
+
* @param {string} code
|
|
20
|
+
* @returns {string}
|
|
21
|
+
*/
|
|
22
|
+
export function parse_mysql(code: string): string;
|
|
23
|
+
/**
|
|
24
|
+
* @param {string} code
|
|
25
|
+
* @returns {string}
|
|
26
|
+
*/
|
|
27
|
+
export function parse_bigquery(code: string): string;
|
|
28
|
+
/**
|
|
29
|
+
* @param {string} code
|
|
30
|
+
* @returns {string}
|
|
31
|
+
*/
|
|
32
|
+
export function parse_snowflake(code: string): string;
|
|
33
|
+
/**
|
|
34
|
+
* @param {string} code
|
|
35
|
+
* @returns {string}
|
|
36
|
+
*/
|
|
37
|
+
export function parse_mssql(code: string): string;
|
|
38
|
+
/**
|
|
39
|
+
* @param {string} code
|
|
40
|
+
* @returns {string | undefined}
|
|
41
|
+
*/
|
|
42
|
+
export function parse_db_resource(code: string): string | undefined;
|
|
43
|
+
/**
|
|
44
|
+
* @param {string} code
|
|
45
|
+
* @returns {string}
|
|
46
|
+
*/
|
|
47
|
+
export function parse_graphql(code: string): string;
|
|
48
|
+
|
|
49
|
+
export type InitInput = RequestInfo | URL | Response | BufferSource | WebAssembly.Module;
|
|
50
|
+
|
|
51
|
+
export interface InitOutput {
|
|
52
|
+
readonly memory: WebAssembly.Memory;
|
|
53
|
+
readonly parse_bash: (a: number, b: number, c: number) => void;
|
|
54
|
+
readonly parse_powershell: (a: number, b: number, c: number) => void;
|
|
55
|
+
readonly parse_sql: (a: number, b: number, c: number) => void;
|
|
56
|
+
readonly parse_mysql: (a: number, b: number, c: number) => void;
|
|
57
|
+
readonly parse_bigquery: (a: number, b: number, c: number) => void;
|
|
58
|
+
readonly parse_snowflake: (a: number, b: number, c: number) => void;
|
|
59
|
+
readonly parse_mssql: (a: number, b: number, c: number) => void;
|
|
60
|
+
readonly parse_db_resource: (a: number, b: number, c: number) => void;
|
|
61
|
+
readonly parse_graphql: (a: number, b: number, c: number) => void;
|
|
62
|
+
readonly __wbindgen_add_to_stack_pointer: (a: number) => number;
|
|
63
|
+
readonly __wbindgen_malloc: (a: number, b: number) => number;
|
|
64
|
+
readonly __wbindgen_realloc: (a: number, b: number, c: number, d: number) => number;
|
|
65
|
+
readonly __wbindgen_free: (a: number, b: number, c: number) => void;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
export type SyncInitInput = BufferSource | WebAssembly.Module;
|
|
69
|
+
/**
|
|
70
|
+
* Instantiates the given `module`, which can either be bytes or
|
|
71
|
+
* a precompiled `WebAssembly.Module`.
|
|
72
|
+
*
|
|
73
|
+
* @param {{ module: SyncInitInput }} module - Passing `SyncInitInput` directly is deprecated.
|
|
74
|
+
*
|
|
75
|
+
* @returns {InitOutput}
|
|
76
|
+
*/
|
|
77
|
+
export function initSync(module: { module: SyncInitInput } | SyncInitInput): InitOutput;
|
|
78
|
+
|
|
79
|
+
/**
|
|
80
|
+
* If `module_or_path` is {RequestInfo} or {URL}, makes a request and
|
|
81
|
+
* for everything else, calls `WebAssembly.instantiate` directly.
|
|
82
|
+
*
|
|
83
|
+
* @param {{ module_or_path: InitInput | Promise<InitInput> }} module_or_path - Passing `InitInput` directly is deprecated.
|
|
84
|
+
*
|
|
85
|
+
* @returns {Promise<InitOutput>}
|
|
86
|
+
*/
|
|
87
|
+
export default function __wbg_init (module_or_path?: { module_or_path: InitInput | Promise<InitInput> } | InitInput | Promise<InitInput>): Promise<InitOutput>;
|
|
@@ -0,0 +1,393 @@
|
|
|
1
|
+
let wasm;
|
|
2
|
+
|
|
3
|
+
let WASM_VECTOR_LEN = 0;
|
|
4
|
+
|
|
5
|
+
let cachedUint8ArrayMemory0 = null;
|
|
6
|
+
|
|
7
|
+
function getUint8ArrayMemory0() {
|
|
8
|
+
if (cachedUint8ArrayMemory0 === null || cachedUint8ArrayMemory0.byteLength === 0) {
|
|
9
|
+
cachedUint8ArrayMemory0 = new Uint8Array(wasm.memory.buffer);
|
|
10
|
+
}
|
|
11
|
+
return cachedUint8ArrayMemory0;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
const cachedTextEncoder = (typeof TextEncoder !== 'undefined' ? new TextEncoder('utf-8') : { encode: () => { throw Error('TextEncoder not available') } } );
|
|
15
|
+
|
|
16
|
+
const encodeString = (typeof cachedTextEncoder.encodeInto === 'function'
|
|
17
|
+
? function (arg, view) {
|
|
18
|
+
return cachedTextEncoder.encodeInto(arg, view);
|
|
19
|
+
}
|
|
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
|
+
|
|
29
|
+
function passStringToWasm0(arg, malloc, realloc) {
|
|
30
|
+
|
|
31
|
+
if (realloc === undefined) {
|
|
32
|
+
const buf = cachedTextEncoder.encode(arg);
|
|
33
|
+
const ptr = malloc(buf.length, 1) >>> 0;
|
|
34
|
+
getUint8ArrayMemory0().subarray(ptr, ptr + buf.length).set(buf);
|
|
35
|
+
WASM_VECTOR_LEN = buf.length;
|
|
36
|
+
return ptr;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
let len = arg.length;
|
|
40
|
+
let ptr = malloc(len, 1) >>> 0;
|
|
41
|
+
|
|
42
|
+
const mem = getUint8ArrayMemory0();
|
|
43
|
+
|
|
44
|
+
let offset = 0;
|
|
45
|
+
|
|
46
|
+
for (; offset < len; offset++) {
|
|
47
|
+
const code = arg.charCodeAt(offset);
|
|
48
|
+
if (code > 0x7F) break;
|
|
49
|
+
mem[ptr + offset] = code;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
if (offset !== len) {
|
|
53
|
+
if (offset !== 0) {
|
|
54
|
+
arg = arg.slice(offset);
|
|
55
|
+
}
|
|
56
|
+
ptr = realloc(ptr, len, len = offset + arg.length * 3, 1) >>> 0;
|
|
57
|
+
const view = getUint8ArrayMemory0().subarray(ptr + offset, ptr + len);
|
|
58
|
+
const ret = encodeString(arg, view);
|
|
59
|
+
|
|
60
|
+
offset += ret.written;
|
|
61
|
+
ptr = realloc(ptr, len, offset, 1) >>> 0;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
WASM_VECTOR_LEN = offset;
|
|
65
|
+
return ptr;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
let cachedDataViewMemory0 = null;
|
|
69
|
+
|
|
70
|
+
function getDataViewMemory0() {
|
|
71
|
+
if (cachedDataViewMemory0 === null || cachedDataViewMemory0.buffer.detached === true || (cachedDataViewMemory0.buffer.detached === undefined && cachedDataViewMemory0.buffer !== wasm.memory.buffer)) {
|
|
72
|
+
cachedDataViewMemory0 = new DataView(wasm.memory.buffer);
|
|
73
|
+
}
|
|
74
|
+
return cachedDataViewMemory0;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
const cachedTextDecoder = (typeof TextDecoder !== 'undefined' ? new TextDecoder('utf-8', { ignoreBOM: true, fatal: true }) : { decode: () => { throw Error('TextDecoder not available') } } );
|
|
78
|
+
|
|
79
|
+
if (typeof TextDecoder !== 'undefined') { cachedTextDecoder.decode(); };
|
|
80
|
+
|
|
81
|
+
function getStringFromWasm0(ptr, len) {
|
|
82
|
+
ptr = ptr >>> 0;
|
|
83
|
+
return cachedTextDecoder.decode(getUint8ArrayMemory0().subarray(ptr, ptr + len));
|
|
84
|
+
}
|
|
85
|
+
/**
|
|
86
|
+
* @param {string} code
|
|
87
|
+
* @returns {string}
|
|
88
|
+
*/
|
|
89
|
+
export function parse_bash(code) {
|
|
90
|
+
let deferred2_0;
|
|
91
|
+
let deferred2_1;
|
|
92
|
+
try {
|
|
93
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
94
|
+
const ptr0 = passStringToWasm0(code, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
95
|
+
const len0 = WASM_VECTOR_LEN;
|
|
96
|
+
wasm.parse_bash(retptr, ptr0, len0);
|
|
97
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
98
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
99
|
+
deferred2_0 = r0;
|
|
100
|
+
deferred2_1 = r1;
|
|
101
|
+
return getStringFromWasm0(r0, r1);
|
|
102
|
+
} finally {
|
|
103
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
104
|
+
wasm.__wbindgen_free(deferred2_0, deferred2_1, 1);
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
/**
|
|
109
|
+
* @param {string} code
|
|
110
|
+
* @returns {string}
|
|
111
|
+
*/
|
|
112
|
+
export function parse_powershell(code) {
|
|
113
|
+
let deferred2_0;
|
|
114
|
+
let deferred2_1;
|
|
115
|
+
try {
|
|
116
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
117
|
+
const ptr0 = passStringToWasm0(code, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
118
|
+
const len0 = WASM_VECTOR_LEN;
|
|
119
|
+
wasm.parse_powershell(retptr, ptr0, len0);
|
|
120
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
121
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
122
|
+
deferred2_0 = r0;
|
|
123
|
+
deferred2_1 = r1;
|
|
124
|
+
return getStringFromWasm0(r0, r1);
|
|
125
|
+
} finally {
|
|
126
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
127
|
+
wasm.__wbindgen_free(deferred2_0, deferred2_1, 1);
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
/**
|
|
132
|
+
* @param {string} code
|
|
133
|
+
* @returns {string}
|
|
134
|
+
*/
|
|
135
|
+
export function parse_sql(code) {
|
|
136
|
+
let deferred2_0;
|
|
137
|
+
let deferred2_1;
|
|
138
|
+
try {
|
|
139
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
140
|
+
const ptr0 = passStringToWasm0(code, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
141
|
+
const len0 = WASM_VECTOR_LEN;
|
|
142
|
+
wasm.parse_sql(retptr, ptr0, len0);
|
|
143
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
144
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
145
|
+
deferred2_0 = r0;
|
|
146
|
+
deferred2_1 = r1;
|
|
147
|
+
return getStringFromWasm0(r0, r1);
|
|
148
|
+
} finally {
|
|
149
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
150
|
+
wasm.__wbindgen_free(deferred2_0, deferred2_1, 1);
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
/**
|
|
155
|
+
* @param {string} code
|
|
156
|
+
* @returns {string}
|
|
157
|
+
*/
|
|
158
|
+
export function parse_mysql(code) {
|
|
159
|
+
let deferred2_0;
|
|
160
|
+
let deferred2_1;
|
|
161
|
+
try {
|
|
162
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
163
|
+
const ptr0 = passStringToWasm0(code, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
164
|
+
const len0 = WASM_VECTOR_LEN;
|
|
165
|
+
wasm.parse_mysql(retptr, ptr0, len0);
|
|
166
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
167
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
168
|
+
deferred2_0 = r0;
|
|
169
|
+
deferred2_1 = r1;
|
|
170
|
+
return getStringFromWasm0(r0, r1);
|
|
171
|
+
} finally {
|
|
172
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
173
|
+
wasm.__wbindgen_free(deferred2_0, deferred2_1, 1);
|
|
174
|
+
}
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
/**
|
|
178
|
+
* @param {string} code
|
|
179
|
+
* @returns {string}
|
|
180
|
+
*/
|
|
181
|
+
export function parse_bigquery(code) {
|
|
182
|
+
let deferred2_0;
|
|
183
|
+
let deferred2_1;
|
|
184
|
+
try {
|
|
185
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
186
|
+
const ptr0 = passStringToWasm0(code, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
187
|
+
const len0 = WASM_VECTOR_LEN;
|
|
188
|
+
wasm.parse_bigquery(retptr, ptr0, len0);
|
|
189
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
190
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
191
|
+
deferred2_0 = r0;
|
|
192
|
+
deferred2_1 = r1;
|
|
193
|
+
return getStringFromWasm0(r0, r1);
|
|
194
|
+
} finally {
|
|
195
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
196
|
+
wasm.__wbindgen_free(deferred2_0, deferred2_1, 1);
|
|
197
|
+
}
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
/**
|
|
201
|
+
* @param {string} code
|
|
202
|
+
* @returns {string}
|
|
203
|
+
*/
|
|
204
|
+
export function parse_snowflake(code) {
|
|
205
|
+
let deferred2_0;
|
|
206
|
+
let deferred2_1;
|
|
207
|
+
try {
|
|
208
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
209
|
+
const ptr0 = passStringToWasm0(code, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
210
|
+
const len0 = WASM_VECTOR_LEN;
|
|
211
|
+
wasm.parse_snowflake(retptr, ptr0, len0);
|
|
212
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
213
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
214
|
+
deferred2_0 = r0;
|
|
215
|
+
deferred2_1 = r1;
|
|
216
|
+
return getStringFromWasm0(r0, r1);
|
|
217
|
+
} finally {
|
|
218
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
219
|
+
wasm.__wbindgen_free(deferred2_0, deferred2_1, 1);
|
|
220
|
+
}
|
|
221
|
+
}
|
|
222
|
+
|
|
223
|
+
/**
|
|
224
|
+
* @param {string} code
|
|
225
|
+
* @returns {string}
|
|
226
|
+
*/
|
|
227
|
+
export function parse_mssql(code) {
|
|
228
|
+
let deferred2_0;
|
|
229
|
+
let deferred2_1;
|
|
230
|
+
try {
|
|
231
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
232
|
+
const ptr0 = passStringToWasm0(code, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
233
|
+
const len0 = WASM_VECTOR_LEN;
|
|
234
|
+
wasm.parse_mssql(retptr, ptr0, len0);
|
|
235
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
236
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
237
|
+
deferred2_0 = r0;
|
|
238
|
+
deferred2_1 = r1;
|
|
239
|
+
return getStringFromWasm0(r0, r1);
|
|
240
|
+
} finally {
|
|
241
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
242
|
+
wasm.__wbindgen_free(deferred2_0, deferred2_1, 1);
|
|
243
|
+
}
|
|
244
|
+
}
|
|
245
|
+
|
|
246
|
+
/**
|
|
247
|
+
* @param {string} code
|
|
248
|
+
* @returns {string | undefined}
|
|
249
|
+
*/
|
|
250
|
+
export function parse_db_resource(code) {
|
|
251
|
+
try {
|
|
252
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
253
|
+
const ptr0 = passStringToWasm0(code, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
254
|
+
const len0 = WASM_VECTOR_LEN;
|
|
255
|
+
wasm.parse_db_resource(retptr, ptr0, len0);
|
|
256
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
257
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
258
|
+
let v2;
|
|
259
|
+
if (r0 !== 0) {
|
|
260
|
+
v2 = getStringFromWasm0(r0, r1).slice();
|
|
261
|
+
wasm.__wbindgen_free(r0, r1 * 1, 1);
|
|
262
|
+
}
|
|
263
|
+
return v2;
|
|
264
|
+
} finally {
|
|
265
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
266
|
+
}
|
|
267
|
+
}
|
|
268
|
+
|
|
269
|
+
/**
|
|
270
|
+
* @param {string} code
|
|
271
|
+
* @returns {string}
|
|
272
|
+
*/
|
|
273
|
+
export function parse_graphql(code) {
|
|
274
|
+
let deferred2_0;
|
|
275
|
+
let deferred2_1;
|
|
276
|
+
try {
|
|
277
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
278
|
+
const ptr0 = passStringToWasm0(code, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
279
|
+
const len0 = WASM_VECTOR_LEN;
|
|
280
|
+
wasm.parse_graphql(retptr, ptr0, len0);
|
|
281
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
282
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
283
|
+
deferred2_0 = r0;
|
|
284
|
+
deferred2_1 = r1;
|
|
285
|
+
return getStringFromWasm0(r0, r1);
|
|
286
|
+
} finally {
|
|
287
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
288
|
+
wasm.__wbindgen_free(deferred2_0, deferred2_1, 1);
|
|
289
|
+
}
|
|
290
|
+
}
|
|
291
|
+
|
|
292
|
+
async function __wbg_load(module, imports) {
|
|
293
|
+
if (typeof Response === 'function' && module instanceof Response) {
|
|
294
|
+
if (typeof WebAssembly.instantiateStreaming === 'function') {
|
|
295
|
+
try {
|
|
296
|
+
return await WebAssembly.instantiateStreaming(module, imports);
|
|
297
|
+
|
|
298
|
+
} catch (e) {
|
|
299
|
+
if (module.headers.get('Content-Type') != 'application/wasm') {
|
|
300
|
+
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);
|
|
301
|
+
|
|
302
|
+
} else {
|
|
303
|
+
throw e;
|
|
304
|
+
}
|
|
305
|
+
}
|
|
306
|
+
}
|
|
307
|
+
|
|
308
|
+
const bytes = await module.arrayBuffer();
|
|
309
|
+
return await WebAssembly.instantiate(bytes, imports);
|
|
310
|
+
|
|
311
|
+
} else {
|
|
312
|
+
const instance = await WebAssembly.instantiate(module, imports);
|
|
313
|
+
|
|
314
|
+
if (instance instanceof WebAssembly.Instance) {
|
|
315
|
+
return { instance, module };
|
|
316
|
+
|
|
317
|
+
} else {
|
|
318
|
+
return instance;
|
|
319
|
+
}
|
|
320
|
+
}
|
|
321
|
+
}
|
|
322
|
+
|
|
323
|
+
function __wbg_get_imports() {
|
|
324
|
+
const imports = {};
|
|
325
|
+
imports.wbg = {};
|
|
326
|
+
|
|
327
|
+
return imports;
|
|
328
|
+
}
|
|
329
|
+
|
|
330
|
+
function __wbg_init_memory(imports, memory) {
|
|
331
|
+
|
|
332
|
+
}
|
|
333
|
+
|
|
334
|
+
function __wbg_finalize_init(instance, module) {
|
|
335
|
+
wasm = instance.exports;
|
|
336
|
+
__wbg_init.__wbindgen_wasm_module = module;
|
|
337
|
+
cachedDataViewMemory0 = null;
|
|
338
|
+
cachedUint8ArrayMemory0 = null;
|
|
339
|
+
|
|
340
|
+
|
|
341
|
+
|
|
342
|
+
return wasm;
|
|
343
|
+
}
|
|
344
|
+
|
|
345
|
+
function initSync(module) {
|
|
346
|
+
if (wasm !== undefined) return wasm;
|
|
347
|
+
|
|
348
|
+
|
|
349
|
+
if (typeof module !== 'undefined' && Object.getPrototypeOf(module) === Object.prototype)
|
|
350
|
+
({module} = module)
|
|
351
|
+
else
|
|
352
|
+
console.warn('using deprecated parameters for `initSync()`; pass a single object instead')
|
|
353
|
+
|
|
354
|
+
const imports = __wbg_get_imports();
|
|
355
|
+
|
|
356
|
+
__wbg_init_memory(imports);
|
|
357
|
+
|
|
358
|
+
if (!(module instanceof WebAssembly.Module)) {
|
|
359
|
+
module = new WebAssembly.Module(module);
|
|
360
|
+
}
|
|
361
|
+
|
|
362
|
+
const instance = new WebAssembly.Instance(module, imports);
|
|
363
|
+
|
|
364
|
+
return __wbg_finalize_init(instance, module);
|
|
365
|
+
}
|
|
366
|
+
|
|
367
|
+
async function __wbg_init(module_or_path) {
|
|
368
|
+
if (wasm !== undefined) return wasm;
|
|
369
|
+
|
|
370
|
+
|
|
371
|
+
if (typeof module_or_path !== 'undefined' && Object.getPrototypeOf(module_or_path) === Object.prototype)
|
|
372
|
+
({module_or_path} = module_or_path)
|
|
373
|
+
else
|
|
374
|
+
console.warn('using deprecated parameters for the initialization function; pass a single object instead')
|
|
375
|
+
|
|
376
|
+
if (typeof module_or_path === 'undefined') {
|
|
377
|
+
module_or_path = new URL('windmill_parser_wasm_bg.wasm', import.meta.url);
|
|
378
|
+
}
|
|
379
|
+
const imports = __wbg_get_imports();
|
|
380
|
+
|
|
381
|
+
if (typeof module_or_path === 'string' || (typeof Request === 'function' && module_or_path instanceof Request) || (typeof URL === 'function' && module_or_path instanceof URL)) {
|
|
382
|
+
module_or_path = fetch(module_or_path);
|
|
383
|
+
}
|
|
384
|
+
|
|
385
|
+
__wbg_init_memory(imports);
|
|
386
|
+
|
|
387
|
+
const { instance, module } = await __wbg_load(await module_or_path, imports);
|
|
388
|
+
|
|
389
|
+
return __wbg_finalize_init(instance, module);
|
|
390
|
+
}
|
|
391
|
+
|
|
392
|
+
export { initSync };
|
|
393
|
+
export default __wbg_init;
|
|
Binary file
|