@jsonui/core 0.2.0 → 0.3.0

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.
@@ -16,3 +16,4 @@ export declare const changeRelativePath: (path: string) => string;
16
16
  export declare function mergeDeep(target: any, ...sources: any): any;
17
17
  export declare const collectObjMerge: (refConst: string, json: any) => {};
18
18
  export declare const collectObjToArray: (refConst: string, json: any) => any[];
19
+ export declare const isCircular: (d: any) => boolean;
package/dist/esm/index.js CHANGED
@@ -6747,7 +6747,16 @@ var collectObjToArray = function (refConst, json) {
6747
6747
  return refs_2;
6748
6748
  }
6749
6749
  return [];
6750
- };var util$1=/*#__PURE__*/Object.freeze({__proto__:null,findLastIndex:findLastIndex,drop:drop,isNumber:isNumber,jsonPointerGet:jsonPointerGet,jsonPointerSet:jsonPointerSet,pathArrayToPathString:pathArrayToPathString,pathArrayToJsonPointer:pathArrayToJsonPointer,isOnlyObject:isOnlyObject,mergePath:mergePath,changeRelativePath:changeRelativePath,mergeDeep:mergeDeep,collectObjMerge:collectObjMerge,collectObjToArray:collectObjToArray});var actionBuilder = function (props, stock) {
6750
+ };
6751
+ var isCircular = function (d) {
6752
+ try {
6753
+ JSON.stringify(d);
6754
+ }
6755
+ catch (e) {
6756
+ return true;
6757
+ }
6758
+ return false;
6759
+ };var util$1=/*#__PURE__*/Object.freeze({__proto__:null,findLastIndex:findLastIndex,drop:drop,isNumber:isNumber,jsonPointerGet:jsonPointerGet,jsonPointerSet:jsonPointerSet,pathArrayToPathString:pathArrayToPathString,pathArrayToJsonPointer:pathArrayToJsonPointer,isOnlyObject:isOnlyObject,mergePath:mergePath,changeRelativePath:changeRelativePath,mergeDeep:mergeDeep,collectObjMerge:collectObjMerge,collectObjToArray:collectObjToArray,isCircular:isCircular});var actionBuilder = function (props, stock) {
6751
6760
  var paths = [];
6752
6761
  props.parentComp; var propsNew = __rest(props
6753
6762
  // eslint-disable-next-line func-names
@@ -14544,7 +14553,7 @@ var reducer = function (state, action) {
14544
14553
  switch (action === null || action === void 0 ? void 0 : action.type) {
14545
14554
  case DATA_UPDATE: {
14546
14555
  var _a = (action === null || action === void 0 ? void 0 : action.payload) || {}, _b = _a.store, store_1 = _b === void 0 ? undefined : _b, _c = _a.path, path = _c === void 0 ? undefined : _c, _d = _a.value, value_1 = _d === void 0 ? undefined : _d, _e = _a.jsonataDef, jsonataDef_1 = _e === void 0 ? undefined : _e, _f = _a.currentPaths, currentPaths = _f === void 0 ? undefined : _f, _g = _a.stock, stock_1 = _g === void 0 ? undefined : _g;
14547
- if (store_1 && path) {
14556
+ if (store_1 && path && !isCircular(value_1)) {
14548
14557
  var storekey = "".concat(store_1);
14549
14558
  var convertedPath_1 = currentPaths && currentPaths[storekey] && currentPaths[storekey].path
14550
14559
  ? changeRelativePath("".concat(currentPaths[storekey].path).concat(SEPARATOR).concat(path))