@goplasmatic/datalogic 4.0.6

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.
@@ -0,0 +1,15 @@
1
+ /* tslint:disable */
2
+ /* eslint-disable */
3
+ export const memory: WebAssembly.Memory;
4
+ export const __wbg_compiledrule_free: (a: number, b: number) => void;
5
+ export const compiledrule_evaluate: (a: number, b: number, c: number) => [number, number, number, number];
6
+ export const compiledrule_new: (a: number, b: number) => [number, number, number];
7
+ export const evaluate: (a: number, b: number, c: number, d: number) => [number, number, number, number];
8
+ export const evaluate_with_trace: (a: number, b: number, c: number, d: number) => [number, number, number, number];
9
+ export const init: () => void;
10
+ export const __wbindgen_free: (a: number, b: number, c: number) => void;
11
+ export const __wbindgen_malloc: (a: number, b: number) => number;
12
+ export const __wbindgen_realloc: (a: number, b: number, c: number, d: number) => number;
13
+ export const __wbindgen_externrefs: WebAssembly.Table;
14
+ export const __externref_table_dealloc: (a: number) => void;
15
+ export const __wbindgen_start: () => void;
package/package.json ADDED
@@ -0,0 +1,71 @@
1
+ {
2
+ "name": "@goplasmatic/datalogic",
3
+ "version": "4.0.6",
4
+ "description": "High-performance JSONLogic engine for JavaScript/TypeScript - WebAssembly powered",
5
+ "license": "Apache-2.0",
6
+ "repository": {
7
+ "type": "git",
8
+ "url": "https://github.com/GoPlasmatic/datalogic-rs"
9
+ },
10
+ "homepage": "https://github.com/GoPlasmatic/datalogic-rs",
11
+ "bugs": {
12
+ "url": "https://github.com/GoPlasmatic/datalogic-rs/issues"
13
+ },
14
+ "keywords": [
15
+ "jsonlogic",
16
+ "json",
17
+ "logic",
18
+ "rules",
19
+ "rules-engine",
20
+ "wasm",
21
+ "webassembly",
22
+ "business-rules"
23
+ ],
24
+ "type": "module",
25
+ "main": "./nodejs/datalogic_wasm.js",
26
+ "module": "./web/datalogic_wasm.js",
27
+ "types": "./web/datalogic_wasm.d.ts",
28
+ "exports": {
29
+ ".": {
30
+ "node": {
31
+ "types": "./nodejs/datalogic_wasm.d.ts",
32
+ "default": "./nodejs/datalogic_wasm.js"
33
+ },
34
+ "import": {
35
+ "types": "./web/datalogic_wasm.d.ts",
36
+ "default": "./web/datalogic_wasm.js"
37
+ },
38
+ "require": {
39
+ "types": "./bundler/datalogic_wasm.d.ts",
40
+ "default": "./bundler/datalogic_wasm.js"
41
+ },
42
+ "default": {
43
+ "types": "./web/datalogic_wasm.d.ts",
44
+ "default": "./web/datalogic_wasm.js"
45
+ }
46
+ },
47
+ "./web": {
48
+ "types": "./web/datalogic_wasm.d.ts",
49
+ "default": "./web/datalogic_wasm.js"
50
+ },
51
+ "./bundler": {
52
+ "types": "./bundler/datalogic_wasm.d.ts",
53
+ "default": "./bundler/datalogic_wasm.js"
54
+ },
55
+ "./nodejs": {
56
+ "types": "./nodejs/datalogic_wasm.d.ts",
57
+ "default": "./nodejs/datalogic_wasm.js"
58
+ }
59
+ },
60
+ "files": [
61
+ "web/",
62
+ "bundler/",
63
+ "nodejs/",
64
+ "LICENSE",
65
+ "README.md"
66
+ ],
67
+ "engines": {
68
+ "node": ">=16.0.0"
69
+ },
70
+ "sideEffects": false
71
+ }
@@ -0,0 +1,109 @@
1
+ /* tslint:disable */
2
+ /* eslint-disable */
3
+
4
+ export class CompiledRule {
5
+ free(): void;
6
+ [Symbol.dispose](): void;
7
+ /**
8
+ * Create a new CompiledRule from a JSONLogic expression.
9
+ *
10
+ * # Arguments
11
+ * * `logic` - JSON string containing the JSONLogic expression
12
+ */
13
+ constructor(logic: string);
14
+ /**
15
+ * Evaluate the compiled rule against data.
16
+ *
17
+ * # Arguments
18
+ * * `data` - JSON string containing the data to evaluate against
19
+ *
20
+ * # Returns
21
+ * JSON string result or error message
22
+ */
23
+ evaluate(data: string): string;
24
+ }
25
+
26
+ /**
27
+ * Evaluate a JSONLogic expression against data.
28
+ *
29
+ * # Arguments
30
+ * * `logic` - JSON string containing the JSONLogic expression
31
+ * * `data` - JSON string containing the data to evaluate against
32
+ *
33
+ * # Returns
34
+ * JSON string result or error message
35
+ */
36
+ export function evaluate(logic: string, data: string): string;
37
+
38
+ /**
39
+ * Evaluate a JSONLogic expression with execution trace for debugging.
40
+ *
41
+ * Returns a JSON string containing the result, expression tree, and execution steps.
42
+ * This enables step-by-step debugging and visualization of the evaluation process.
43
+ *
44
+ * # Arguments
45
+ * * `logic` - JSON string containing the JSONLogic expression
46
+ * * `data` - JSON string containing the data to evaluate against
47
+ *
48
+ * # Returns
49
+ * JSON string containing TracedResult (result, expression_tree, steps) or error message
50
+ *
51
+ * # Example Output
52
+ * ```json
53
+ * {
54
+ * "result": true,
55
+ * "expression_tree": {
56
+ * "id": 0,
57
+ * "expression": "{\"and\": [...]}",
58
+ * "children": [...]
59
+ * },
60
+ * "steps": [
61
+ * {"id": 0, "node_id": 2, "context": {...}, "result": 25, "error": null},
62
+ * ...
63
+ * ]
64
+ * }
65
+ * ```
66
+ */
67
+ export function evaluate_with_trace(logic: string, data: string): string;
68
+
69
+ export function init(): void;
70
+
71
+ export type InitInput = RequestInfo | URL | Response | BufferSource | WebAssembly.Module;
72
+
73
+ export interface InitOutput {
74
+ readonly memory: WebAssembly.Memory;
75
+ readonly __wbg_compiledrule_free: (a: number, b: number) => void;
76
+ readonly compiledrule_evaluate: (a: number, b: number, c: number) => [number, number, number, number];
77
+ readonly compiledrule_new: (a: number, b: number) => [number, number, number];
78
+ readonly evaluate: (a: number, b: number, c: number, d: number) => [number, number, number, number];
79
+ readonly evaluate_with_trace: (a: number, b: number, c: number, d: number) => [number, number, number, number];
80
+ readonly init: () => void;
81
+ readonly __wbindgen_free: (a: number, b: number, c: number) => void;
82
+ readonly __wbindgen_malloc: (a: number, b: number) => number;
83
+ readonly __wbindgen_realloc: (a: number, b: number, c: number, d: number) => number;
84
+ readonly __wbindgen_externrefs: WebAssembly.Table;
85
+ readonly __externref_table_dealloc: (a: number) => void;
86
+ readonly __wbindgen_start: () => void;
87
+ }
88
+
89
+ export type SyncInitInput = BufferSource | WebAssembly.Module;
90
+
91
+ /**
92
+ * Instantiates the given `module`, which can either be bytes or
93
+ * a precompiled `WebAssembly.Module`.
94
+ *
95
+ * @param {{ module: SyncInitInput }} module - Passing `SyncInitInput` directly is deprecated.
96
+ *
97
+ * @returns {InitOutput}
98
+ */
99
+ export function initSync(module: { module: SyncInitInput } | SyncInitInput): InitOutput;
100
+
101
+ /**
102
+ * If `module_or_path` is {RequestInfo} or {URL}, makes a request and
103
+ * for everything else, calls `WebAssembly.instantiate` directly.
104
+ *
105
+ * @param {{ module_or_path: InitInput | Promise<InitInput> }} module_or_path - Passing `InitInput` directly is deprecated.
106
+ *
107
+ * @returns {Promise<InitOutput>}
108
+ */
109
+ export default function __wbg_init (module_or_path?: { module_or_path: InitInput | Promise<InitInput> } | InitInput | Promise<InitInput>): Promise<InitOutput>;
@@ -0,0 +1,400 @@
1
+ let wasm;
2
+
3
+ let cachedDataViewMemory0 = null;
4
+ function getDataViewMemory0() {
5
+ if (cachedDataViewMemory0 === null || cachedDataViewMemory0.buffer.detached === true || (cachedDataViewMemory0.buffer.detached === undefined && cachedDataViewMemory0.buffer !== wasm.memory.buffer)) {
6
+ cachedDataViewMemory0 = new DataView(wasm.memory.buffer);
7
+ }
8
+ return cachedDataViewMemory0;
9
+ }
10
+
11
+ function getStringFromWasm0(ptr, len) {
12
+ ptr = ptr >>> 0;
13
+ return decodeText(ptr, len);
14
+ }
15
+
16
+ let cachedUint8ArrayMemory0 = null;
17
+ function getUint8ArrayMemory0() {
18
+ if (cachedUint8ArrayMemory0 === null || cachedUint8ArrayMemory0.byteLength === 0) {
19
+ cachedUint8ArrayMemory0 = new Uint8Array(wasm.memory.buffer);
20
+ }
21
+ return cachedUint8ArrayMemory0;
22
+ }
23
+
24
+ function passStringToWasm0(arg, malloc, realloc) {
25
+ if (realloc === undefined) {
26
+ const buf = cachedTextEncoder.encode(arg);
27
+ const ptr = malloc(buf.length, 1) >>> 0;
28
+ getUint8ArrayMemory0().subarray(ptr, ptr + buf.length).set(buf);
29
+ WASM_VECTOR_LEN = buf.length;
30
+ return ptr;
31
+ }
32
+
33
+ let len = arg.length;
34
+ let ptr = malloc(len, 1) >>> 0;
35
+
36
+ const mem = getUint8ArrayMemory0();
37
+
38
+ let offset = 0;
39
+
40
+ for (; offset < len; offset++) {
41
+ const code = arg.charCodeAt(offset);
42
+ if (code > 0x7F) break;
43
+ mem[ptr + offset] = code;
44
+ }
45
+ if (offset !== len) {
46
+ if (offset !== 0) {
47
+ arg = arg.slice(offset);
48
+ }
49
+ ptr = realloc(ptr, len, len = offset + arg.length * 3, 1) >>> 0;
50
+ const view = getUint8ArrayMemory0().subarray(ptr + offset, ptr + len);
51
+ const ret = cachedTextEncoder.encodeInto(arg, view);
52
+
53
+ offset += ret.written;
54
+ ptr = realloc(ptr, len, offset, 1) >>> 0;
55
+ }
56
+
57
+ WASM_VECTOR_LEN = offset;
58
+ return ptr;
59
+ }
60
+
61
+ function takeFromExternrefTable0(idx) {
62
+ const value = wasm.__wbindgen_externrefs.get(idx);
63
+ wasm.__externref_table_dealloc(idx);
64
+ return value;
65
+ }
66
+
67
+ let cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true, fatal: true });
68
+ cachedTextDecoder.decode();
69
+ const MAX_SAFARI_DECODE_BYTES = 2146435072;
70
+ let numBytesDecoded = 0;
71
+ function decodeText(ptr, len) {
72
+ numBytesDecoded += len;
73
+ if (numBytesDecoded >= MAX_SAFARI_DECODE_BYTES) {
74
+ cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true, fatal: true });
75
+ cachedTextDecoder.decode();
76
+ numBytesDecoded = len;
77
+ }
78
+ return cachedTextDecoder.decode(getUint8ArrayMemory0().subarray(ptr, ptr + len));
79
+ }
80
+
81
+ const cachedTextEncoder = new TextEncoder();
82
+
83
+ if (!('encodeInto' in cachedTextEncoder)) {
84
+ cachedTextEncoder.encodeInto = function (arg, view) {
85
+ const buf = cachedTextEncoder.encode(arg);
86
+ view.set(buf);
87
+ return {
88
+ read: arg.length,
89
+ written: buf.length
90
+ };
91
+ }
92
+ }
93
+
94
+ let WASM_VECTOR_LEN = 0;
95
+
96
+ const CompiledRuleFinalization = (typeof FinalizationRegistry === 'undefined')
97
+ ? { register: () => {}, unregister: () => {} }
98
+ : new FinalizationRegistry(ptr => wasm.__wbg_compiledrule_free(ptr >>> 0, 1));
99
+
100
+ /**
101
+ * A compiled JSONLogic rule that can be evaluated multiple times.
102
+ *
103
+ * Use this when you need to evaluate the same logic against different data,
104
+ * as it avoids re-parsing the logic on each evaluation.
105
+ */
106
+ export class CompiledRule {
107
+ __destroy_into_raw() {
108
+ const ptr = this.__wbg_ptr;
109
+ this.__wbg_ptr = 0;
110
+ CompiledRuleFinalization.unregister(this);
111
+ return ptr;
112
+ }
113
+ free() {
114
+ const ptr = this.__destroy_into_raw();
115
+ wasm.__wbg_compiledrule_free(ptr, 0);
116
+ }
117
+ /**
118
+ * Create a new CompiledRule from a JSONLogic expression.
119
+ *
120
+ * # Arguments
121
+ * * `logic` - JSON string containing the JSONLogic expression
122
+ * @param {string} logic
123
+ */
124
+ constructor(logic) {
125
+ const ptr0 = passStringToWasm0(logic, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
126
+ const len0 = WASM_VECTOR_LEN;
127
+ const ret = wasm.compiledrule_new(ptr0, len0);
128
+ if (ret[2]) {
129
+ throw takeFromExternrefTable0(ret[1]);
130
+ }
131
+ this.__wbg_ptr = ret[0] >>> 0;
132
+ CompiledRuleFinalization.register(this, this.__wbg_ptr, this);
133
+ return this;
134
+ }
135
+ /**
136
+ * Evaluate the compiled rule against data.
137
+ *
138
+ * # Arguments
139
+ * * `data` - JSON string containing the data to evaluate against
140
+ *
141
+ * # Returns
142
+ * JSON string result or error message
143
+ * @param {string} data
144
+ * @returns {string}
145
+ */
146
+ evaluate(data) {
147
+ let deferred3_0;
148
+ let deferred3_1;
149
+ try {
150
+ const ptr0 = passStringToWasm0(data, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
151
+ const len0 = WASM_VECTOR_LEN;
152
+ const ret = wasm.compiledrule_evaluate(this.__wbg_ptr, ptr0, len0);
153
+ var ptr2 = ret[0];
154
+ var len2 = ret[1];
155
+ if (ret[3]) {
156
+ ptr2 = 0; len2 = 0;
157
+ throw takeFromExternrefTable0(ret[2]);
158
+ }
159
+ deferred3_0 = ptr2;
160
+ deferred3_1 = len2;
161
+ return getStringFromWasm0(ptr2, len2);
162
+ } finally {
163
+ wasm.__wbindgen_free(deferred3_0, deferred3_1, 1);
164
+ }
165
+ }
166
+ }
167
+ if (Symbol.dispose) CompiledRule.prototype[Symbol.dispose] = CompiledRule.prototype.free;
168
+
169
+ /**
170
+ * Evaluate a JSONLogic expression against data.
171
+ *
172
+ * # Arguments
173
+ * * `logic` - JSON string containing the JSONLogic expression
174
+ * * `data` - JSON string containing the data to evaluate against
175
+ *
176
+ * # Returns
177
+ * JSON string result or error message
178
+ * @param {string} logic
179
+ * @param {string} data
180
+ * @returns {string}
181
+ */
182
+ export function evaluate(logic, data) {
183
+ let deferred4_0;
184
+ let deferred4_1;
185
+ try {
186
+ const ptr0 = passStringToWasm0(logic, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
187
+ const len0 = WASM_VECTOR_LEN;
188
+ const ptr1 = passStringToWasm0(data, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
189
+ const len1 = WASM_VECTOR_LEN;
190
+ const ret = wasm.evaluate(ptr0, len0, ptr1, len1);
191
+ var ptr3 = ret[0];
192
+ var len3 = ret[1];
193
+ if (ret[3]) {
194
+ ptr3 = 0; len3 = 0;
195
+ throw takeFromExternrefTable0(ret[2]);
196
+ }
197
+ deferred4_0 = ptr3;
198
+ deferred4_1 = len3;
199
+ return getStringFromWasm0(ptr3, len3);
200
+ } finally {
201
+ wasm.__wbindgen_free(deferred4_0, deferred4_1, 1);
202
+ }
203
+ }
204
+
205
+ /**
206
+ * Evaluate a JSONLogic expression with execution trace for debugging.
207
+ *
208
+ * Returns a JSON string containing the result, expression tree, and execution steps.
209
+ * This enables step-by-step debugging and visualization of the evaluation process.
210
+ *
211
+ * # Arguments
212
+ * * `logic` - JSON string containing the JSONLogic expression
213
+ * * `data` - JSON string containing the data to evaluate against
214
+ *
215
+ * # Returns
216
+ * JSON string containing TracedResult (result, expression_tree, steps) or error message
217
+ *
218
+ * # Example Output
219
+ * ```json
220
+ * {
221
+ * "result": true,
222
+ * "expression_tree": {
223
+ * "id": 0,
224
+ * "expression": "{\"and\": [...]}",
225
+ * "children": [...]
226
+ * },
227
+ * "steps": [
228
+ * {"id": 0, "node_id": 2, "context": {...}, "result": 25, "error": null},
229
+ * ...
230
+ * ]
231
+ * }
232
+ * ```
233
+ * @param {string} logic
234
+ * @param {string} data
235
+ * @returns {string}
236
+ */
237
+ export function evaluate_with_trace(logic, data) {
238
+ let deferred4_0;
239
+ let deferred4_1;
240
+ try {
241
+ const ptr0 = passStringToWasm0(logic, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
242
+ const len0 = WASM_VECTOR_LEN;
243
+ const ptr1 = passStringToWasm0(data, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
244
+ const len1 = WASM_VECTOR_LEN;
245
+ const ret = wasm.evaluate_with_trace(ptr0, len0, ptr1, len1);
246
+ var ptr3 = ret[0];
247
+ var len3 = ret[1];
248
+ if (ret[3]) {
249
+ ptr3 = 0; len3 = 0;
250
+ throw takeFromExternrefTable0(ret[2]);
251
+ }
252
+ deferred4_0 = ptr3;
253
+ deferred4_1 = len3;
254
+ return getStringFromWasm0(ptr3, len3);
255
+ } finally {
256
+ wasm.__wbindgen_free(deferred4_0, deferred4_1, 1);
257
+ }
258
+ }
259
+
260
+ export function init() {
261
+ wasm.init();
262
+ }
263
+
264
+ const EXPECTED_RESPONSE_TYPES = new Set(['basic', 'cors', 'default']);
265
+
266
+ async function __wbg_load(module, imports) {
267
+ if (typeof Response === 'function' && module instanceof Response) {
268
+ if (typeof WebAssembly.instantiateStreaming === 'function') {
269
+ try {
270
+ return await WebAssembly.instantiateStreaming(module, imports);
271
+ } catch (e) {
272
+ const validResponse = module.ok && EXPECTED_RESPONSE_TYPES.has(module.type);
273
+
274
+ if (validResponse && module.headers.get('Content-Type') !== 'application/wasm') {
275
+ 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);
276
+
277
+ } else {
278
+ throw e;
279
+ }
280
+ }
281
+ }
282
+
283
+ const bytes = await module.arrayBuffer();
284
+ return await WebAssembly.instantiate(bytes, imports);
285
+ } else {
286
+ const instance = await WebAssembly.instantiate(module, imports);
287
+
288
+ if (instance instanceof WebAssembly.Instance) {
289
+ return { instance, module };
290
+ } else {
291
+ return instance;
292
+ }
293
+ }
294
+ }
295
+
296
+ function __wbg_get_imports() {
297
+ const imports = {};
298
+ imports.wbg = {};
299
+ imports.wbg.__wbg___wbindgen_throw_dd24417ed36fc46e = function(arg0, arg1) {
300
+ throw new Error(getStringFromWasm0(arg0, arg1));
301
+ };
302
+ imports.wbg.__wbg_error_7534b8e9a36f1ab4 = function(arg0, arg1) {
303
+ let deferred0_0;
304
+ let deferred0_1;
305
+ try {
306
+ deferred0_0 = arg0;
307
+ deferred0_1 = arg1;
308
+ console.error(getStringFromWasm0(arg0, arg1));
309
+ } finally {
310
+ wasm.__wbindgen_free(deferred0_0, deferred0_1, 1);
311
+ }
312
+ };
313
+ imports.wbg.__wbg_new_8a6f238a6ece86ea = function() {
314
+ const ret = new Error();
315
+ return ret;
316
+ };
317
+ imports.wbg.__wbg_stack_0ed75d68575b0f3c = function(arg0, arg1) {
318
+ const ret = arg1.stack;
319
+ const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
320
+ const len1 = WASM_VECTOR_LEN;
321
+ getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
322
+ getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
323
+ };
324
+ imports.wbg.__wbindgen_cast_2241b6af4c4b2941 = function(arg0, arg1) {
325
+ // Cast intrinsic for `Ref(String) -> Externref`.
326
+ const ret = getStringFromWasm0(arg0, arg1);
327
+ return ret;
328
+ };
329
+ imports.wbg.__wbindgen_init_externref_table = function() {
330
+ const table = wasm.__wbindgen_externrefs;
331
+ const offset = table.grow(4);
332
+ table.set(0, undefined);
333
+ table.set(offset + 0, undefined);
334
+ table.set(offset + 1, null);
335
+ table.set(offset + 2, true);
336
+ table.set(offset + 3, false);
337
+ };
338
+
339
+ return imports;
340
+ }
341
+
342
+ function __wbg_finalize_init(instance, module) {
343
+ wasm = instance.exports;
344
+ __wbg_init.__wbindgen_wasm_module = module;
345
+ cachedDataViewMemory0 = null;
346
+ cachedUint8ArrayMemory0 = null;
347
+
348
+
349
+ wasm.__wbindgen_start();
350
+ return wasm;
351
+ }
352
+
353
+ function initSync(module) {
354
+ if (wasm !== undefined) return wasm;
355
+
356
+
357
+ if (typeof module !== 'undefined') {
358
+ if (Object.getPrototypeOf(module) === Object.prototype) {
359
+ ({module} = module)
360
+ } else {
361
+ console.warn('using deprecated parameters for `initSync()`; pass a single object instead')
362
+ }
363
+ }
364
+
365
+ const imports = __wbg_get_imports();
366
+ if (!(module instanceof WebAssembly.Module)) {
367
+ module = new WebAssembly.Module(module);
368
+ }
369
+ const instance = new WebAssembly.Instance(module, imports);
370
+ return __wbg_finalize_init(instance, module);
371
+ }
372
+
373
+ async function __wbg_init(module_or_path) {
374
+ if (wasm !== undefined) return wasm;
375
+
376
+
377
+ if (typeof module_or_path !== 'undefined') {
378
+ if (Object.getPrototypeOf(module_or_path) === Object.prototype) {
379
+ ({module_or_path} = module_or_path)
380
+ } else {
381
+ console.warn('using deprecated parameters for the initialization function; pass a single object instead')
382
+ }
383
+ }
384
+
385
+ if (typeof module_or_path === 'undefined') {
386
+ module_or_path = new URL('datalogic_wasm_bg.wasm', import.meta.url);
387
+ }
388
+ const imports = __wbg_get_imports();
389
+
390
+ if (typeof module_or_path === 'string' || (typeof Request === 'function' && module_or_path instanceof Request) || (typeof URL === 'function' && module_or_path instanceof URL)) {
391
+ module_or_path = fetch(module_or_path);
392
+ }
393
+
394
+ const { instance, module } = await __wbg_load(await module_or_path, imports);
395
+
396
+ return __wbg_finalize_init(instance, module);
397
+ }
398
+
399
+ export { initSync };
400
+ export default __wbg_init;
Binary file
@@ -0,0 +1,15 @@
1
+ /* tslint:disable */
2
+ /* eslint-disable */
3
+ export const memory: WebAssembly.Memory;
4
+ export const __wbg_compiledrule_free: (a: number, b: number) => void;
5
+ export const compiledrule_evaluate: (a: number, b: number, c: number) => [number, number, number, number];
6
+ export const compiledrule_new: (a: number, b: number) => [number, number, number];
7
+ export const evaluate: (a: number, b: number, c: number, d: number) => [number, number, number, number];
8
+ export const evaluate_with_trace: (a: number, b: number, c: number, d: number) => [number, number, number, number];
9
+ export const init: () => void;
10
+ export const __wbindgen_free: (a: number, b: number, c: number) => void;
11
+ export const __wbindgen_malloc: (a: number, b: number) => number;
12
+ export const __wbindgen_realloc: (a: number, b: number, c: number, d: number) => number;
13
+ export const __wbindgen_externrefs: WebAssembly.Table;
14
+ export const __externref_table_dealloc: (a: number) => void;
15
+ export const __wbindgen_start: () => void;