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