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