@rkmodules/rules 0.0.149 → 0.0.151

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.cjs.js CHANGED
@@ -703,9 +703,6 @@ function interpolate(inputs, scope) {
703
703
  }));
704
704
  }
705
705
 
706
- /**
707
- * TODO: need rank polymorhism on the tree item sizes
708
- */
709
706
  var getValue = {
710
707
  name: "getValue",
711
708
  label: "Get Value",
@@ -714,20 +711,24 @@ var getValue = {
714
711
  tree: "any",
715
712
  path: "string",
716
713
  },
714
+ params: {
715
+ removeEmpty: { type: "boolean", default: false, label: "remove empty" },
716
+ },
717
717
  outputs: {
718
718
  tree: "any",
719
719
  },
720
- // TODO: may want to do something with other values of path
721
- impl: function (inputs, params) { return __awaiter(void 0, void 0, void 0, function () {
722
- var paths, tree;
723
- return __generator(this, function (_a) {
724
- paths = toArray(inputs.path || {});
725
- tree = mapTree(inputs.tree || {}, function (value) {
726
- // get the property from the object
727
- var val = getValue$1(value, paths[0]);
720
+ impl: function (_a, params_1) { return __awaiter(void 0, [_a, params_1], void 0, function (_b, params) {
721
+ var result;
722
+ var _c = _b.tree, tree = _c === void 0 ? {} : _c, _d = _b.path, path = _d === void 0 ? {} : _d;
723
+ return __generator(this, function (_e) {
724
+ result = binaryOnTree(tree, path, function (value, path) {
725
+ var val = getValue$1(value, path);
726
+ if ((val === undefined || val === null) && params.removeEmpty) {
727
+ return DISCARD;
728
+ }
728
729
  return val;
729
- });
730
- return [2 /*return*/, { tree: tree }];
730
+ }, true);
731
+ return [2 /*return*/, { tree: result }];
731
732
  });
732
733
  }); },
733
734
  };
@@ -1554,7 +1555,7 @@ var filterList = {
1554
1555
  keep: "boolean",
1555
1556
  },
1556
1557
  params: {
1557
- removeEmpty: { type: "boolean", default: false },
1558
+ removeEmpty: { type: "boolean", default: false, label: "remove empty" },
1558
1559
  },
1559
1560
  outputs: {
1560
1561
  list: "any",
@@ -1966,7 +1967,7 @@ var mergeTree = {
1966
1967
  name: "mergeTree",
1967
1968
  label: "Merge Tree",
1968
1969
  description: "Merge groups with the same index into a single tree.",
1969
- nodeType: "NamedInput",
1970
+ nodeType: "DynamicInput",
1970
1971
  inputs: {},
1971
1972
  outputs: {
1972
1973
  result: "any",
@@ -8486,6 +8487,7 @@ function DDContext(_a) {
8486
8487
  return React.createElement(DndProvider, { backend: HTML5Backend }, children);
8487
8488
  }
8488
8489
 
8490
+ exports.Control = Control;
8489
8491
  exports.DDContext = DDContext;
8490
8492
  exports.DISCARD = DISCARD;
8491
8493
  exports.Engine = Engine;