@rkmodules/rules 0.0.85 → 0.0.86

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
@@ -2009,6 +2009,9 @@ var Engine = /** @class */ (function () {
2009
2009
  console.warn("Invalid nodes for edge deletion");
2010
2010
  return newFn;
2011
2011
  }
2012
+ if (!fn) {
2013
+ throw new Error("Function ".concat(to === null || to === void 0 ? void 0 : to.name, " not found in index, which is unexpected as you are deleting an edge to it."));
2014
+ }
2012
2015
  if (to.inputs && to.inputs[toField] === "<".concat(fromNode, ".").concat(fromField, ">")) {
2013
2016
  // revert to default value if exists
2014
2017
  delete to.inputs[toField];
@@ -2037,8 +2040,12 @@ var Engine = /** @class */ (function () {
2037
2040
  id = uid$1();
2038
2041
  }
2039
2042
  // get inputs defaults
2043
+ var fn = this.fnIndex[nodeName];
2044
+ if (!fn) {
2045
+ throw new Error("Function ".concat(nodeName, " not found in index. Use engine.build() to add custom functions."));
2046
+ }
2040
2047
  var inputs = {};
2041
- Object.entries(this.fnIndex[nodeName].inputs || {}).forEach(function (_a) {
2048
+ Object.entries(fn.inputs || {}).forEach(function (_a) {
2042
2049
  var _b = __read(_a, 2), key = _b[0], def = _b[1];
2043
2050
  var normDef = normalizeVarDef(def);
2044
2051
  if (normDef.default !== undefined) {
@@ -2047,7 +2054,7 @@ var Engine = /** @class */ (function () {
2047
2054
  });
2048
2055
  // get params defaults
2049
2056
  var params = {};
2050
- Object.entries(this.fnIndex[nodeName].params || {}).forEach(function (_a) {
2057
+ Object.entries(fn.params || {}).forEach(function (_a) {
2051
2058
  var _b = __read(_a, 2), key = _b[0], def = _b[1];
2052
2059
  var normDef = normalizeVarDef(def);
2053
2060
  if (normDef.default !== undefined) {