Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
printResult(qryResult: IResult) {
if (this.shouldProcess()) {
this.errorMessage = "";
var resultType = Util.getType(qryResult.result);
this.resultCount =
resultType === DATA_TYPE.Array
? qryResult.result.length
: 0;
this.timeTaken = qryResult.timeTaken.toString();
this.showResultInfo = true;
let result = qryResult.result;
switch (resultType) {
case DATA_TYPE.Array:
var rowsLength = result.length,
htmlString = "",
props: string[] = [];
for (var prop in result[0]) {
props.push(prop);
htmlString += "" + prop + "";
}
const propLength = props.length;
htmlString += "";
// var width = 100 / propLength;
for (var i = 0; i < rowsLength; i++) {
var tempHtml = "";
for (var j = 0; j < propLength; j++) {
if (result[0] && result[0][0]) {
tempHtml += "" + result[i][props[j]] + "";
} else {
name: 'submissionType',
dataType: DATA_TYPE.String,
notNull: true
}, {
name: 'schedule',
dataType: DATA_TYPE.Number
}, {
name: 'isScheduled',
dataType: DATA_TYPE.Boolean,
default: false
}, {
name: 'fileInfo',
dataType: DATA_TYPE.Object
}, {
name: 'additionalFileInfo',
dataType: DATA_TYPE.Array
}, {
name: 'fileMap',
dataType: DATA_TYPE.Object
}, {
name: 'formData',
dataType: DATA_TYPE.Object
}, {
name: 'postStats',
dataType: DATA_TYPE.Object
}]
}
export { SubmissionTable, SubmissionTableName }
printResult(qryResult: IResult) {
if (this.shouldProcess()) {
this.errorMessage = "";
var resultType = Util.getType(qryResult.result);
this.resultCount =
resultType === DATA_TYPE.Array
? qryResult.result.length
: 0;
this.timeTaken = qryResult.timeTaken.toString();
this.showResultInfo = true;
let result = qryResult.result;
switch (resultType) {
case DATA_TYPE.Array:
var rowsLength = result.length,
htmlString = "",
props: string[] = [];
for (var prop in result[0]) {
props.push(prop);
htmlString += "" + prop + "";
}
const propLength = props.length;
htmlString += "";
static getType(value) {
if (value === null) {
return DATA_TYPE.Null;
}
var type = typeof value;
switch (type) {
case 'object':
if (Array.isArray(value)) {
return DATA_TYPE.Array;
}
default:
return type;
}
}