@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 +7 -3
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.esm.js +7 -3
- package/dist/index.esm.js.map +1 -1
- package/dist/lib/Engine/index.d.ts +2 -1
- package/dist/lib/Engine/types.d.ts +2 -1
- package/package.json +1 -1
- package/readme.md +26 -1
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();
|
|
@@ -1943,11 +1945,13 @@ var Engine = /** @class */ (function () {
|
|
|
1943
1945
|
if (!builtFn) {
|
|
1944
1946
|
// not yet build
|
|
1945
1947
|
builtFn = this.build(node);
|
|
1948
|
+
// mount if needed
|
|
1949
|
+
this.mount(builtFn);
|
|
1946
1950
|
}
|
|
1947
1951
|
return [2 /*return*/, this.run(builtFn, inputs)];
|
|
1948
1952
|
}
|
|
1949
1953
|
mappedInputs = interpolate(inputs, {});
|
|
1950
|
-
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))];
|
|
1951
1955
|
case 1:
|
|
1952
1956
|
result = _b.sent();
|
|
1953
1957
|
// console.log("Engine run complete", result);
|