@rkmodules/rules 0.0.79 → 0.0.81

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
@@ -1715,12 +1715,14 @@ function topSort(fn) {
1715
1715
  return __assign(__assign({}, fn), { body: orderedBody });
1716
1716
  }
1717
1717
  var Engine = /** @class */ (function () {
1718
- function Engine(morePrimitives) {
1718
+ function Engine(morePrimitives, env) {
1719
1719
  if (morePrimitives === void 0) { morePrimitives = {}; }
1720
+ if (env === void 0) { env = {}; }
1720
1721
  this.listeners = {};
1721
1722
  this.cache = {};
1722
1723
  this.cacheMiss = Symbol("cacheMiss");
1723
1724
  this.fnIndex = __assign(__assign({}, primitives), morePrimitives);
1725
+ this.env = env;
1724
1726
  }
1725
1727
  Engine.prototype.checkCache = function (fnName, inputs) {
1726
1728
  if (!this.cache[fnName]) {
@@ -1790,7 +1792,7 @@ var Engine = /** @class */ (function () {
1790
1792
  context: context,
1791
1793
  startTime: startTime_1,
1792
1794
  });
1793
- return [4 /*yield*/, fn.impl(inputs_1, params_1)];
1795
+ return [4 /*yield*/, fn.impl(inputs_1, params_1, this)];
1794
1796
  case 3:
1795
1797
  result_1 = _e.sent();
1796
1798
  endTime_1 = performance.now();
@@ -1945,11 +1947,13 @@ var Engine = /** @class */ (function () {
1945
1947
  if (!builtFn) {
1946
1948
  // not yet build
1947
1949
  builtFn = this.build(node);
1950
+ // mount if needed
1951
+ this.mount(builtFn);
1948
1952
  }
1949
1953
  return [2 /*return*/, this.run(builtFn, inputs)];
1950
1954
  }
1951
1955
  mappedInputs = interpolate(inputs, {});
1952
- return [4 /*yield*/, ((_a = node.impl) === null || _a === void 0 ? void 0 : _a.call(node, mappedInputs, {}))];
1956
+ return [4 /*yield*/, ((_a = node.impl) === null || _a === void 0 ? void 0 : _a.call(node, mappedInputs, {}, this))];
1953
1957
  case 1:
1954
1958
  result = _b.sent();
1955
1959
  // console.log("Engine run complete", result);