@json-eval-rs/bundler 0.0.54 → 0.0.55
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/dist/index.d.ts +8 -0
- package/dist/index.js +10 -0
- package/package.json +1 -1
- package/pkg/json_eval_rs.d.ts +12 -4
- package/pkg/json_eval_rs_bg.js +40 -8
- package/pkg/json_eval_rs_bg.wasm +0 -0
- package/pkg/json_eval_rs_bg.wasm.d.ts +1 -0
package/dist/index.d.ts
CHANGED
|
@@ -16,6 +16,14 @@ export declare class JSONEval extends JSONEvalCore {
|
|
|
16
16
|
* @returns New instance
|
|
17
17
|
*/
|
|
18
18
|
static fromCache(cacheKey: string, context?: any, data?: any): JSONEval;
|
|
19
|
+
/**
|
|
20
|
+
* Evaluate logic expression without creating an instance
|
|
21
|
+
* @param logicStr - JSON Logic expression (string or object)
|
|
22
|
+
* @param data - Optional data (string or object)
|
|
23
|
+
* @param context - Optional context (string or object)
|
|
24
|
+
* @returns Evaluation result
|
|
25
|
+
*/
|
|
26
|
+
static evaluateLogic(logicStr: string | object, data?: any, context?: any): any;
|
|
19
27
|
}
|
|
20
28
|
/**
|
|
21
29
|
* Get library version
|
package/dist/index.js
CHANGED
|
@@ -27,6 +27,16 @@ export class JSONEval extends JSONEvalCore {
|
|
|
27
27
|
fromCache: true
|
|
28
28
|
});
|
|
29
29
|
}
|
|
30
|
+
/**
|
|
31
|
+
* Evaluate logic expression without creating an instance
|
|
32
|
+
* @param logicStr - JSON Logic expression (string or object)
|
|
33
|
+
* @param data - Optional data (string or object)
|
|
34
|
+
* @param context - Optional context (string or object)
|
|
35
|
+
* @returns Evaluation result
|
|
36
|
+
*/
|
|
37
|
+
static evaluateLogic(logicStr, data, context) {
|
|
38
|
+
return JSONEvalCore.evaluateLogic(wasm, logicStr, data, context);
|
|
39
|
+
}
|
|
30
40
|
}
|
|
31
41
|
/**
|
|
32
42
|
* Get library version
|
package/package.json
CHANGED
package/pkg/json_eval_rs.d.ts
CHANGED
|
@@ -1,9 +1,5 @@
|
|
|
1
1
|
/* tslint:disable */
|
|
2
2
|
/* eslint-disable */
|
|
3
|
-
/**
|
|
4
|
-
* Initialize the library (sets up panic hook)
|
|
5
|
-
*/
|
|
6
|
-
export function init(): void;
|
|
7
3
|
/**
|
|
8
4
|
* Get library version (alias)
|
|
9
5
|
*/
|
|
@@ -12,6 +8,10 @@ export function version(): string;
|
|
|
12
8
|
* Get the library version
|
|
13
9
|
*/
|
|
14
10
|
export function getVersion(): string;
|
|
11
|
+
/**
|
|
12
|
+
* Initialize the library (sets up panic hook)
|
|
13
|
+
*/
|
|
14
|
+
export function init(): void;
|
|
15
15
|
/**
|
|
16
16
|
* WebAssembly wrapper for JSONEval
|
|
17
17
|
*/
|
|
@@ -49,6 +49,14 @@ export class JSONEvalWasm {
|
|
|
49
49
|
* @returns Result as JavaScript object
|
|
50
50
|
*/
|
|
51
51
|
compileAndRunLogic(logic_str: string, data?: string | null, context?: string | null): any;
|
|
52
|
+
/**
|
|
53
|
+
* Static helper to evaluate logic without creating an instance
|
|
54
|
+
* @param logic_str - JSON logic expression string
|
|
55
|
+
* @param data - Optional JSON data string
|
|
56
|
+
* @param context - Optional JSON context string
|
|
57
|
+
* @returns Result as JavaScript object
|
|
58
|
+
*/
|
|
59
|
+
static evaluateLogic(logic_str: string, data?: string | null, context?: string | null): any;
|
|
52
60
|
/**
|
|
53
61
|
* Evaluate dependents and return as JavaScript object
|
|
54
62
|
*
|
package/pkg/json_eval_rs_bg.js
CHANGED
|
@@ -152,13 +152,6 @@ function passArrayJsValueToWasm0(array, malloc) {
|
|
|
152
152
|
WASM_VECTOR_LEN = array.length;
|
|
153
153
|
return ptr;
|
|
154
154
|
}
|
|
155
|
-
/**
|
|
156
|
-
* Initialize the library (sets up panic hook)
|
|
157
|
-
*/
|
|
158
|
-
export function init() {
|
|
159
|
-
wasm.init();
|
|
160
|
-
}
|
|
161
|
-
|
|
162
155
|
/**
|
|
163
156
|
* Get library version (alias)
|
|
164
157
|
* @returns {string}
|
|
@@ -201,6 +194,13 @@ export function getVersion() {
|
|
|
201
194
|
}
|
|
202
195
|
}
|
|
203
196
|
|
|
197
|
+
/**
|
|
198
|
+
* Initialize the library (sets up panic hook)
|
|
199
|
+
*/
|
|
200
|
+
export function init() {
|
|
201
|
+
wasm.init();
|
|
202
|
+
}
|
|
203
|
+
|
|
204
204
|
function passArray8ToWasm0(arg, malloc) {
|
|
205
205
|
const ptr = malloc(arg.length * 1, 1) >>> 0;
|
|
206
206
|
getUint8ArrayMemory0().set(arg, ptr / 1);
|
|
@@ -376,6 +376,38 @@ export class JSONEvalWasm {
|
|
|
376
376
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
377
377
|
}
|
|
378
378
|
}
|
|
379
|
+
/**
|
|
380
|
+
* Static helper to evaluate logic without creating an instance
|
|
381
|
+
* @param logic_str - JSON logic expression string
|
|
382
|
+
* @param data - Optional JSON data string
|
|
383
|
+
* @param context - Optional JSON context string
|
|
384
|
+
* @returns Result as JavaScript object
|
|
385
|
+
* @param {string} logic_str
|
|
386
|
+
* @param {string | null} [data]
|
|
387
|
+
* @param {string | null} [context]
|
|
388
|
+
* @returns {any}
|
|
389
|
+
*/
|
|
390
|
+
static evaluateLogic(logic_str, data, context) {
|
|
391
|
+
try {
|
|
392
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
393
|
+
const ptr0 = passStringToWasm0(logic_str, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
|
|
394
|
+
const len0 = WASM_VECTOR_LEN;
|
|
395
|
+
var ptr1 = isLikeNone(data) ? 0 : passStringToWasm0(data, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
|
|
396
|
+
var len1 = WASM_VECTOR_LEN;
|
|
397
|
+
var ptr2 = isLikeNone(context) ? 0 : passStringToWasm0(context, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
|
|
398
|
+
var len2 = WASM_VECTOR_LEN;
|
|
399
|
+
wasm.jsonevalwasm_evaluateLogic(retptr, ptr0, len0, ptr1, len1, ptr2, len2);
|
|
400
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
401
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
402
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
403
|
+
if (r2) {
|
|
404
|
+
throw takeObject(r1);
|
|
405
|
+
}
|
|
406
|
+
return takeObject(r0);
|
|
407
|
+
} finally {
|
|
408
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
409
|
+
}
|
|
410
|
+
}
|
|
379
411
|
/**
|
|
380
412
|
* Evaluate dependents and return as JavaScript object
|
|
381
413
|
*
|
|
@@ -2124,7 +2156,7 @@ export function __wbg_getTime_6bb3f64e0f18f817(arg0) {
|
|
|
2124
2156
|
return ret;
|
|
2125
2157
|
};
|
|
2126
2158
|
|
|
2127
|
-
export function
|
|
2159
|
+
export function __wbg_log_81520727e210fff2(arg0, arg1) {
|
|
2128
2160
|
console.log(getStringFromWasm0(arg0, arg1));
|
|
2129
2161
|
};
|
|
2130
2162
|
|
package/pkg/json_eval_rs_bg.wasm
CHANGED
|
Binary file
|
|
@@ -19,6 +19,7 @@ export const jsonevalwasm_evaluateDependentsJS: (a: number, b: number, c: number
|
|
|
19
19
|
export const jsonevalwasm_evaluateDependentsSubform: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number, j: number, k: number) => void;
|
|
20
20
|
export const jsonevalwasm_evaluateDependentsSubformJS: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number, j: number, k: number) => void;
|
|
21
21
|
export const jsonevalwasm_evaluateJS: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number) => void;
|
|
22
|
+
export const jsonevalwasm_evaluateLogic: (a: number, b: number, c: number, d: number, e: number, f: number, g: number) => void;
|
|
22
23
|
export const jsonevalwasm_evaluateSubform: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number, j: number) => void;
|
|
23
24
|
export const jsonevalwasm_getEvaluatedSchema: (a: number, b: number, c: number) => void;
|
|
24
25
|
export const jsonevalwasm_getEvaluatedSchemaByPath: (a: number, b: number, c: number, d: number, e: number) => void;
|