@rkmodules/rules 0.0.59 → 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
@@ -1545,15 +1545,24 @@ var Engine = /** @class */ (function () {
1545
1545
  return newFn;
1546
1546
  };
1547
1547
  Engine.prototype.applyEdgeDelete = function (oldFn, fromNode, toNode, fromField, toField) {
1548
+ var _a;
1548
1549
  var newFn = __assign(__assign({}, oldFn), { body: __assign({}, oldFn.body) });
1549
1550
  var from = newFn.body[fromNode];
1550
1551
  var to = newFn.body[toNode];
1552
+ var fn = this.fnIndex[to === null || to === void 0 ? void 0 : to.name];
1551
1553
  if (!from || !to) {
1552
1554
  console.warn("Invalid nodes for edge deletion");
1553
1555
  return newFn;
1554
1556
  }
1555
1557
  if (to.inputs && to.inputs[toField] === "<".concat(fromNode, ".").concat(fromField, ">")) {
1558
+ // revert to default value if exists
1556
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
+ }
1557
1566
  }
1558
1567
  else {
1559
1568
  console.warn("No matching edge found to delete");