@rkmodules/rules 0.0.58 → 0.0.60

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
@@ -926,6 +926,7 @@ var filterList = {
926
926
  },
927
927
  outputs: {
928
928
  list: "any",
929
+ others: "any",
929
930
  },
930
931
  impl: function (inputs) { return __awaiter(void 0, void 0, void 0, function () {
931
932
  return __generator(this, function (_a) {
@@ -936,6 +937,12 @@ var filterList = {
936
937
  true);
937
938
  });
938
939
  }),
940
+ others: binaryOnTreeBranch(inputs.list || {}, inputs.keep || {}, function (branchA, branchB) {
941
+ return branchA.filter(function (item, index) {
942
+ return (branchB[Math.min(index, branchB.length - 1)] ===
943
+ false);
944
+ });
945
+ }),
939
946
  }];
940
947
  });
941
948
  }); },
@@ -1538,15 +1545,24 @@ var Engine = /** @class */ (function () {
1538
1545
  return newFn;
1539
1546
  };
1540
1547
  Engine.prototype.applyEdgeDelete = function (oldFn, fromNode, toNode, fromField, toField) {
1548
+ var _a;
1541
1549
  var newFn = __assign(__assign({}, oldFn), { body: __assign({}, oldFn.body) });
1542
1550
  var from = newFn.body[fromNode];
1543
1551
  var to = newFn.body[toNode];
1552
+ var fn = this.fnIndex[to === null || to === void 0 ? void 0 : to.name];
1544
1553
  if (!from || !to) {
1545
1554
  console.warn("Invalid nodes for edge deletion");
1546
1555
  return newFn;
1547
1556
  }
1548
1557
  if (to.inputs && to.inputs[toField] === "<".concat(fromNode, ".").concat(fromField, ">")) {
1558
+ // revert to default value if exists
1549
1559
  delete to.inputs[toField];
1560
+ if ((_a = fn.inputs) === null || _a === void 0 ? void 0 : _a[toField]) {
1561
+ var normDef = normalizeVarDef(fn.inputs[toField]);
1562
+ if (normDef.default !== undefined) {
1563
+ to.inputs[toField] = normDef.default;
1564
+ }
1565
+ }
1550
1566
  }
1551
1567
  else {
1552
1568
  console.warn("No matching edge found to delete");