@json-eval-rs/webcore 0.0.47 → 0.0.48
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.js +8 -8
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -146,8 +146,9 @@ export class JSONEvalCore {
|
|
|
146
146
|
async evaluateDependents({ changedPaths, data, context, reEvaluate = false }) {
|
|
147
147
|
await this.init();
|
|
148
148
|
try {
|
|
149
|
-
|
|
150
|
-
|
|
149
|
+
// Ensure paths is an array for WASM
|
|
150
|
+
const paths = Array.isArray(changedPaths) ? changedPaths : [changedPaths];
|
|
151
|
+
return this._instance.evaluateDependentsJS(JSON.stringify(paths), data ? JSON.stringify(data) : null, context ? JSON.stringify(context) : null, reEvaluate);
|
|
151
152
|
}
|
|
152
153
|
catch (error) {
|
|
153
154
|
throw new Error(`Dependent evaluation failed: ${error.message || error}`);
|
|
@@ -194,7 +195,7 @@ export class JSONEvalCore {
|
|
|
194
195
|
*/
|
|
195
196
|
async getEvaluatedSchemaByPaths({ paths, skipLayout = false, format = 0 }) {
|
|
196
197
|
await this.init();
|
|
197
|
-
return this._instance.getEvaluatedSchemaByPathsJS(paths, skipLayout, format);
|
|
198
|
+
return this._instance.getEvaluatedSchemaByPathsJS(JSON.stringify(paths), skipLayout, format);
|
|
198
199
|
}
|
|
199
200
|
/**
|
|
200
201
|
* Get a value from the schema using dotted path notation
|
|
@@ -209,7 +210,7 @@ export class JSONEvalCore {
|
|
|
209
210
|
*/
|
|
210
211
|
async getSchemaByPaths({ paths, format = 0 }) {
|
|
211
212
|
await this.init();
|
|
212
|
-
return this._instance.getSchemaByPathsJS(paths, format);
|
|
213
|
+
return this._instance.getSchemaByPathsJS(JSON.stringify(paths), format);
|
|
213
214
|
}
|
|
214
215
|
/**
|
|
215
216
|
* Reload schema with new data
|
|
@@ -399,8 +400,7 @@ export class JSONEvalCore {
|
|
|
399
400
|
await this.init();
|
|
400
401
|
// For backward compatibility, accept single changedPath too (though types say array)
|
|
401
402
|
const paths = Array.isArray(changedPaths) ? changedPaths : [changedPaths];
|
|
402
|
-
return this._instance.evaluateDependentsSubformJS(subformPath, paths,
|
|
403
|
-
data ? JSON.stringify(data) : null, context ? JSON.stringify(context) : null);
|
|
403
|
+
return this._instance.evaluateDependentsSubformJS(subformPath, JSON.stringify(paths), data ? JSON.stringify(data) : null, context ? JSON.stringify(context) : null);
|
|
404
404
|
}
|
|
405
405
|
/**
|
|
406
406
|
* Resolve layout for subform
|
|
@@ -443,7 +443,7 @@ export class JSONEvalCore {
|
|
|
443
443
|
*/
|
|
444
444
|
async getEvaluatedSchemaByPathsSubform({ subformPath, schemaPaths, skipLayout = false, format = 0 }) {
|
|
445
445
|
await this.init();
|
|
446
|
-
return this._instance.getEvaluatedSchemaByPathsSubformJS(subformPath, schemaPaths, skipLayout, format);
|
|
446
|
+
return this._instance.getEvaluatedSchemaByPathsSubformJS(subformPath, JSON.stringify(schemaPaths), skipLayout, format);
|
|
447
447
|
}
|
|
448
448
|
/**
|
|
449
449
|
* Get list of available subform paths
|
|
@@ -465,7 +465,7 @@ export class JSONEvalCore {
|
|
|
465
465
|
*/
|
|
466
466
|
async getSchemaByPathsSubform({ subformPath, schemaPaths, format = 0 }) {
|
|
467
467
|
await this.init();
|
|
468
|
-
return this._instance.getSchemaByPathsSubformJS(subformPath, schemaPaths, format);
|
|
468
|
+
return this._instance.getSchemaByPathsSubformJS(subformPath, JSON.stringify(schemaPaths), format);
|
|
469
469
|
}
|
|
470
470
|
/**
|
|
471
471
|
* Check if a subform exists at the given path
|