UNPKG

som-exp-sdk

Version:

Evaluate the User Expression

32 lines (31 loc) 1.43 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.EvalSdkCore = void 0; const index_1 = require("./index"); class EvalSdkCore { constructor(opts) { if (opts && !opts.isHealthy()) { throw new Error(`No http-client found or host given!`); } else { // setting connection properties this.host = opts.getHost(); this.port = opts.getPort(); this.basePath = opts.getBaseUrl(); this.baseUrl = `${!!this.port ? (`${this.host}:${this.port}`) : this.host}, ${this.basePath ? this.basePath : ""}`; console.log(`Base URL is resolved to be: ${this.baseUrl}`); // initializing expression properties this.baseExpression = new index_1.BaseExpression(); this.conditionalExpression = new index_1.ConditionalExpression(); this.sentenceExpression = new index_1.SentenceExpression(); this.numericalExpression = new index_1.NumericalExpression(); this.dateExpression = new index_1.DateExpression(); this.timeExpression = new index_1.TimeExpression(); this.financialExpression = new index_1.FinancialExpression(); this.loopExpression = new index_1.LoopExpression(); this.expressionEvaluator = new index_1.ExpressionEvaluator(); } } } exports.EvalSdkCore = EvalSdkCore;