-
Notifications
You must be signed in to change notification settings - Fork 48
/
Copy pathindex.js
40 lines (35 loc) · 1.05 KB
/
index.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
/*
*
* ©2016-2017 EdgeVerve Systems Limited (a fully owned Infosys subsidiary),
* Bangalore, India. All Rights Reserved.
*
*/
const decisionTable = require('./utils/helper/decision-table');
const decisionLogic = require('./utils/helper/decision-logic');
const feel = require('./dist/feel');
const decisionService = require('./utils/helper/decision-service');
const { configureLogger } = require('./logger');
const feelSettings = require('./settings');
const jsFeel = {
decisionTable,
feel,
decisionLogic,
decisionService,
};
jsFeel.init = function (settings) {
const { logger, enableLexerLogging, enableExecutionLogging, logResult } = settings;
configureLogger(logger);
if (enableExecutionLogging !== undefined) {
feelSettings.enableExecutionLogging = enableExecutionLogging;
}
if (enableLexerLogging !== undefined) {
feelSettings.enableLexerLogging = enableLexerLogging;
}
if (logResult !== undefined) {
feelSettings.logResult = logResult;
}
};
jsFeel.use = function (plugin) {
plugin.call(this);
};
module.exports = () => jsFeel;