@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.cjs.js +9 -0
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.esm.js +9 -0
- package/dist/index.esm.js.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs.js
CHANGED
|
@@ -1547,15 +1547,24 @@ var Engine = /** @class */ (function () {
|
|
|
1547
1547
|
return newFn;
|
|
1548
1548
|
};
|
|
1549
1549
|
Engine.prototype.applyEdgeDelete = function (oldFn, fromNode, toNode, fromField, toField) {
|
|
1550
|
+
var _a;
|
|
1550
1551
|
var newFn = __assign(__assign({}, oldFn), { body: __assign({}, oldFn.body) });
|
|
1551
1552
|
var from = newFn.body[fromNode];
|
|
1552
1553
|
var to = newFn.body[toNode];
|
|
1554
|
+
var fn = this.fnIndex[to === null || to === void 0 ? void 0 : to.name];
|
|
1553
1555
|
if (!from || !to) {
|
|
1554
1556
|
console.warn("Invalid nodes for edge deletion");
|
|
1555
1557
|
return newFn;
|
|
1556
1558
|
}
|
|
1557
1559
|
if (to.inputs && to.inputs[toField] === "<".concat(fromNode, ".").concat(fromField, ">")) {
|
|
1560
|
+
// revert to default value if exists
|
|
1558
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
|
+
}
|
|
1559
1568
|
}
|
|
1560
1569
|
else {
|
|
1561
1570
|
console.warn("No matching edge found to delete");
|