@gorules/zen-engine 0.18.0 → 0.19.2
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/README.md +2 -0
- package/index.d.ts +5 -0
- package/package.json +7 -7
package/README.md
CHANGED
|
@@ -40,6 +40,7 @@ import fs from 'fs/promises';
|
|
|
40
40
|
|
|
41
41
|
const decision = engine.createDecision(content);
|
|
42
42
|
const result = await decision.evaluate({ input: 15 });
|
|
43
|
+
engine.dispose();
|
|
43
44
|
})();
|
|
44
45
|
```
|
|
45
46
|
|
|
@@ -58,6 +59,7 @@ const loader = async (key: string) => fs.readFile(path.join(testDataRoot, key))(
|
|
|
58
59
|
const engine = new ZenEngine({ loader });
|
|
59
60
|
|
|
60
61
|
const result = await engine.evaluate('jdm_graph1.json', { input: 5 });
|
|
62
|
+
engine.dispose();
|
|
61
63
|
})();
|
|
62
64
|
```
|
|
63
65
|
|
package/index.d.ts
CHANGED
|
@@ -54,6 +54,11 @@ export class ZenEngine {
|
|
|
54
54
|
evaluate(key: string, context: any, opts?: ZenEvaluateOptions | undefined | null): Promise<ZenEngineResponse>
|
|
55
55
|
createDecision(content: ZenDecisionContent | Buffer | object): ZenDecision
|
|
56
56
|
getDecision(key: string): Promise<ZenDecision>
|
|
57
|
+
/**
|
|
58
|
+
* Function used to dispose memory allocated for loaders
|
|
59
|
+
* In the future, it will likely be removed and made automatic
|
|
60
|
+
*/
|
|
61
|
+
dispose(): void
|
|
57
62
|
}
|
|
58
63
|
export class ZenEngineHandlerRequest {
|
|
59
64
|
input: any
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gorules/zen-engine",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.19.2",
|
|
4
4
|
"main": "index.js",
|
|
5
5
|
"types": "./index.d.ts",
|
|
6
6
|
"license": "MIT",
|
|
@@ -79,12 +79,12 @@
|
|
|
79
79
|
"prepublishOnly": "napi prepublish",
|
|
80
80
|
"version": "napi version"
|
|
81
81
|
},
|
|
82
|
-
"gitHead": "
|
|
82
|
+
"gitHead": "71aebdbd2a2fe4de7f0052d42c18168fe86fba18",
|
|
83
83
|
"optionalDependencies": {
|
|
84
|
-
"@gorules/zen-engine-darwin-x64": "0.
|
|
85
|
-
"@gorules/zen-engine-linux-x64-gnu": "0.
|
|
86
|
-
"@gorules/zen-engine-win32-x64-msvc": "0.
|
|
87
|
-
"@gorules/zen-engine-linux-arm64-gnu": "0.
|
|
88
|
-
"@gorules/zen-engine-darwin-arm64": "0.
|
|
84
|
+
"@gorules/zen-engine-darwin-x64": "0.19.2",
|
|
85
|
+
"@gorules/zen-engine-linux-x64-gnu": "0.19.2",
|
|
86
|
+
"@gorules/zen-engine-win32-x64-msvc": "0.19.2",
|
|
87
|
+
"@gorules/zen-engine-linux-arm64-gnu": "0.19.2",
|
|
88
|
+
"@gorules/zen-engine-darwin-arm64": "0.19.2"
|
|
89
89
|
}
|
|
90
90
|
}
|