@json-eval-rs/webcore 0.0.77 → 0.0.79

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 CHANGED
@@ -535,7 +535,8 @@ export declare class JSONEvalCore {
535
535
  */
536
536
  evaluateSubform({ subformPath, data, context, paths, }: EvaluateSubformOptions): Promise<void>;
537
537
  /**
538
- * Validate subform data against its schema rules
538
+ * Validate subform data against its schema rules (returns parsed JavaScript object)
539
+ * Uses validateSubformJS for Worker-safe serialization
539
540
  */
540
541
  validateSubform({ subformPath, data, context, }: ValidateSubformOptions): Promise<ValidationResult>;
541
542
  /**
package/dist/index.js CHANGED
@@ -474,11 +474,17 @@ export class JSONEvalCore {
474
474
  return this._instance.evaluateSubform(subformPath, typeof data === "string" ? data : JSONStringify(data), context ? typeof context === "string" ? context : JSONStringify(context) : null, paths || null);
475
475
  }
476
476
  /**
477
- * Validate subform data against its schema rules
477
+ * Validate subform data against its schema rules (returns parsed JavaScript object)
478
+ * Uses validateSubformJS for Worker-safe serialization
478
479
  */
479
480
  async validateSubform({ subformPath, data, context, }) {
480
481
  await this.init();
481
- return this._instance.validateSubform(subformPath, typeof data === "string" ? data : JSONStringify(data), context ? typeof context === "string" ? context : JSONStringify(context) : null);
482
+ try {
483
+ return this._instance.validateSubformJS(subformPath, typeof data === "string" ? data : JSONStringify(data), context ? typeof context === "string" ? context : JSONStringify(context) : null);
484
+ }
485
+ catch (error) {
486
+ throw new Error(`Subform validation failed: ${error.message || error}`);
487
+ }
482
488
  }
483
489
  /**
484
490
  * Evaluate dependent fields in subform
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@json-eval-rs/webcore",
3
- "version": "0.0.77",
3
+ "version": "0.0.79",
4
4
  "description": "JSON Eval RS core JavaScript wrapper (internal package - not published)",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",