@rkmodules/rules 0.0.135 → 0.0.137

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.esm.js CHANGED
@@ -2187,15 +2187,23 @@ var groupAnd = {
2187
2187
  inputs: {
2188
2188
  tree: "boolean",
2189
2189
  },
2190
+ params: {
2191
+ merge: "boolean",
2192
+ },
2190
2193
  outputs: {
2191
2194
  result: "boolean",
2192
2195
  },
2193
- impl: function (inputs) { return __awaiter(void 0, void 0, void 0, function () {
2196
+ impl: function (inputs, params) { return __awaiter(void 0, void 0, void 0, function () {
2197
+ var result;
2194
2198
  return __generator(this, function (_a) {
2199
+ result = mapTreeBranch(inputs.tree || {}, function (branch) {
2200
+ return [branch.reduce(function (acc, val) { return acc && val; }, true)];
2201
+ });
2202
+ if (params.merge) {
2203
+ result = trimTree(result, 1);
2204
+ }
2195
2205
  return [2 /*return*/, {
2196
- result: mapTreeBranch(inputs.tree || {}, function (branch) {
2197
- return [branch.reduce(function (acc, val) { return acc && val; }, true)];
2198
- }),
2206
+ result: result,
2199
2207
  }];
2200
2208
  });
2201
2209
  }); },
@@ -2208,15 +2216,23 @@ var groupOr = {
2208
2216
  inputs: {
2209
2217
  tree: "boolean",
2210
2218
  },
2219
+ params: {
2220
+ merge: "boolean",
2221
+ },
2211
2222
  outputs: {
2212
2223
  result: "boolean",
2213
2224
  },
2214
- impl: function (inputs) { return __awaiter(void 0, void 0, void 0, function () {
2225
+ impl: function (inputs, params) { return __awaiter(void 0, void 0, void 0, function () {
2226
+ var result;
2215
2227
  return __generator(this, function (_a) {
2228
+ result = mapTreeBranch(inputs.tree || {}, function (branch) {
2229
+ return [branch.reduce(function (acc, val) { return acc || val; }, false)];
2230
+ });
2231
+ if (params.merge) {
2232
+ result = trimTree(result, 1);
2233
+ }
2216
2234
  return [2 /*return*/, {
2217
- result: mapTreeBranch(inputs.tree || {}, function (branch) {
2218
- return [branch.reduce(function (acc, val) { return acc || val; }, false)];
2219
- }),
2235
+ result: result,
2220
2236
  }];
2221
2237
  });
2222
2238
  }); },
@@ -6638,9 +6654,13 @@ var OutputNode = React.memo(function (_a) {
6638
6654
  newName = _b.sent();
6639
6655
  if (newName !== null && newName !== oldName) {
6640
6656
  (_a = data.onIOChange) === null || _a === void 0 ? void 0 : _a.call(data, function (fn) {
6657
+ var keys = Object.keys(fn.outputs || {});
6658
+ var newKeys = keys.map(function (key) {
6659
+ return key === oldName ? newName : key;
6660
+ });
6641
6661
  var outputs = __assign({}, fn.outputs);
6642
6662
  outputs[newName] = outputs[oldName];
6643
- delete outputs[oldName];
6663
+ outputs = Object.fromEntries(newKeys.map(function (key) { return [key, outputs[key]]; }));
6644
6664
  return { outputs: outputs };
6645
6665
  });
6646
6666
  }