@rkmodules/rules 0.0.135 → 0.0.136

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
@@ -2189,15 +2189,23 @@ var groupAnd = {
2189
2189
  inputs: {
2190
2190
  tree: "boolean",
2191
2191
  },
2192
+ params: {
2193
+ merge: "boolean",
2194
+ },
2192
2195
  outputs: {
2193
2196
  result: "boolean",
2194
2197
  },
2195
- impl: function (inputs) { return __awaiter(void 0, void 0, void 0, function () {
2198
+ impl: function (inputs, params) { return __awaiter(void 0, void 0, void 0, function () {
2199
+ var result;
2196
2200
  return __generator(this, function (_a) {
2201
+ result = mapTreeBranch(inputs.tree || {}, function (branch) {
2202
+ return [branch.reduce(function (acc, val) { return acc && val; }, true)];
2203
+ });
2204
+ if (params.merge) {
2205
+ result = trimTree(result, 1);
2206
+ }
2197
2207
  return [2 /*return*/, {
2198
- result: mapTreeBranch(inputs.tree || {}, function (branch) {
2199
- return [branch.reduce(function (acc, val) { return acc && val; }, true)];
2200
- }),
2208
+ result: result,
2201
2209
  }];
2202
2210
  });
2203
2211
  }); },
@@ -2210,15 +2218,23 @@ var groupOr = {
2210
2218
  inputs: {
2211
2219
  tree: "boolean",
2212
2220
  },
2221
+ params: {
2222
+ merge: "boolean",
2223
+ },
2213
2224
  outputs: {
2214
2225
  result: "boolean",
2215
2226
  },
2216
- impl: function (inputs) { return __awaiter(void 0, void 0, void 0, function () {
2227
+ impl: function (inputs, params) { return __awaiter(void 0, void 0, void 0, function () {
2228
+ var result;
2217
2229
  return __generator(this, function (_a) {
2230
+ result = mapTreeBranch(inputs.tree || {}, function (branch) {
2231
+ return [branch.reduce(function (acc, val) { return acc || val; }, false)];
2232
+ });
2233
+ if (params.merge) {
2234
+ result = trimTree(result, 1);
2235
+ }
2218
2236
  return [2 /*return*/, {
2219
- result: mapTreeBranch(inputs.tree || {}, function (branch) {
2220
- return [branch.reduce(function (acc, val) { return acc || val; }, false)];
2221
- }),
2237
+ result: result,
2222
2238
  }];
2223
2239
  });
2224
2240
  }); },