Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
public executeQry(query: string): Promise {
if (Config.isLogEnabled === true) {
console.log("qry from service - " + query);
}
const con = this.connection;
return new Promise((resolve, reject) => {
var startTime = performance.now();
this.evaluateQry_(query).then(qryResult => {
const idbResult: IResult = {
timeTaken: (performance.now() - startTime) / 1000,
result: qryResult
};
resolve(idbResult);
if (Config.isLogEnabled === true) {
console.log("result from service evaluated");
}
}).catch(err => {
reject(err);
tempHtml += "";
htmlString += tempHtml;
}
this.resultInnerHtml = htmlString;
break;
case DATA_TYPE.Object:
result = JSON.stringify(result);
case DATA_TYPE.String:
case DATA_TYPE.Number:
this.resultInnerHtml = result;
break;
default:
this.resultInnerHtml = JSON.stringify(result);
}
if (Config.isLogEnabled) {
console.table(result);
}
}
}
this.evaluateQry_(query).then(qryResult => {
const idbResult: IResult = {
timeTaken: (performance.now() - startTime) / 1000,
result: qryResult
};
resolve(idbResult);
if (Config.isLogEnabled === true) {
console.log("result from service evaluated");
}
}).catch(err => {
reject(err);
setLogFromUrl() {
var log = Util.getParameterByName("log");
if (!Util.isNull(log)) {
Config.isLogEnabled = true;
}
}
constructor() {
this.connection.setLogStatus(Config.isLogEnabled);
}