@json-eval-rs/webcore 0.0.53 → 0.0.54
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 +4 -0
- package/dist/index.js +11 -3
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -484,6 +484,10 @@ export declare class JSONEvalCore {
|
|
|
484
484
|
* Validate data against schema rules with optional path filtering
|
|
485
485
|
*/
|
|
486
486
|
validatePaths({ data, context, paths }: EvaluateOptions): Promise<ValidationResult>;
|
|
487
|
+
/**
|
|
488
|
+
* Cancel any running evaluation
|
|
489
|
+
*/
|
|
490
|
+
cancel(): Promise<void>;
|
|
487
491
|
/**
|
|
488
492
|
* Evaluate a subform with data
|
|
489
493
|
*/
|
package/dist/index.js
CHANGED
|
@@ -148,7 +148,7 @@ export class JSONEvalCore {
|
|
|
148
148
|
/**
|
|
149
149
|
* Evaluate dependent fields (returns parsed JavaScript object, processes transitively)
|
|
150
150
|
*/
|
|
151
|
-
async evaluateDependents({ changedPaths, data, context, reEvaluate =
|
|
151
|
+
async evaluateDependents({ changedPaths, data, context, reEvaluate = true }) {
|
|
152
152
|
await this.init();
|
|
153
153
|
try {
|
|
154
154
|
// Ensure paths is an array for WASM
|
|
@@ -379,6 +379,14 @@ export class JSONEvalCore {
|
|
|
379
379
|
throw new Error(`Validation failed: ${error.message || error}`);
|
|
380
380
|
}
|
|
381
381
|
}
|
|
382
|
+
/**
|
|
383
|
+
* Cancel any running evaluation
|
|
384
|
+
*/
|
|
385
|
+
async cancel() {
|
|
386
|
+
if (this._ready && this._instance) {
|
|
387
|
+
this._instance.cancel();
|
|
388
|
+
}
|
|
389
|
+
}
|
|
382
390
|
// ============================================================================
|
|
383
391
|
// Subform Methods
|
|
384
392
|
// ============================================================================
|
|
@@ -399,11 +407,11 @@ export class JSONEvalCore {
|
|
|
399
407
|
/**
|
|
400
408
|
* Evaluate dependent fields in subform
|
|
401
409
|
*/
|
|
402
|
-
async evaluateDependentsSubform({ subformPath, changedPaths, data, context, reEvaluate =
|
|
410
|
+
async evaluateDependentsSubform({ subformPath, changedPaths, data, context, reEvaluate = true }) {
|
|
403
411
|
await this.init();
|
|
404
412
|
// For backward compatibility, accept single changedPath too (though types say array)
|
|
405
413
|
const paths = Array.isArray(changedPaths) ? changedPaths : [changedPaths];
|
|
406
|
-
return this._instance.evaluateDependentsSubformJS(subformPath, JSON.stringify(paths), data ? JSON.stringify(data) : null, context ? JSON.stringify(context) : null);
|
|
414
|
+
return this._instance.evaluateDependentsSubformJS(subformPath, JSON.stringify(paths), data ? JSON.stringify(data) : null, context ? JSON.stringify(context) : null, reEvaluate);
|
|
407
415
|
}
|
|
408
416
|
/**
|
|
409
417
|
* Resolve layout for subform
|