Skip to content

Commit

Permalink
ok, linter madness .
Browse files Browse the repository at this point in the history
  • Loading branch information
demmings committed Dec 31, 2023
1 parent cd91205 commit 3f33a54
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 31 deletions.
24 changes: 11 additions & 13 deletions dist/gssql.js
Original file line number Diff line number Diff line change
Expand Up @@ -2146,15 +2146,13 @@ class SelectTables {
groupedTableData = this.having(ast.HAVING, groupedTableData);
}
}
else {
// If any conglomerate field functions (SUM, COUNT,...)
// we summarize all records into ONE.
if (this.tableFields.getConglomerateFieldCount() > 0) {
const compressedData = [];
const conglomerate = new ConglomerateRecord(this.tableFields.getSelectFields());
compressedData.push(conglomerate.squish(viewTableData));
groupedTableData = compressedData;
}
// If any conglomerate field functions (SUM, COUNT,...)
// we summarize all records into ONE.
else if (this.tableFields.getConglomerateFieldCount() > 0) {
const compressedData = [];
const conglomerate = new ConglomerateRecord(this.tableFields.getSelectFields());
compressedData.push(conglomerate.squish(viewTableData));
groupedTableData = compressedData;
}

return groupedTableData;
Expand Down Expand Up @@ -3903,7 +3901,7 @@ class AggregateTrack {
* @param {Number} numericData
* @returns {Number}
*/
maxCase(numericData) {
maxCase(numericData) {
this.groupValue = this.first ? numericData : this.groupValue;
this.first = false;
this.groupValue = numericData > this.groupValue ? numericData : this.groupValue;
Expand Down Expand Up @@ -5174,7 +5172,7 @@ class JoinTablesRecordIds {
*
* @param {String} calcField
* @param {String[]} columns
* @returns {TableField}
* @returns {Object}
*/
searchColumnsForTable(calcField, columns) {
let fieldInfo = null;
Expand All @@ -5183,7 +5181,7 @@ class JoinTablesRecordIds {
for (const col of columns) {
fieldInfo = this.tableFields.getFieldInfo(col);
if (typeof fieldInfo !== 'undefined') {
foundTableField = Object.assign({}, fieldInfo);
foundTableField = {...fieldInfo};
foundTableField.calculatedFormula = calcField;
return foundTableField;
}
Expand Down Expand Up @@ -7135,7 +7133,7 @@ class ScriptSettings { // skipcq: JS-0128
continue;
}

const propertyOfThisApplication = propertyValue !== null && propertyValue.expiry !== undefined;
const propertyOfThisApplication = propertyValue?.expiry !== undefined;

if (propertyOfThisApplication && (PropertyData.isExpired(propertyValue) || deleteAll)) {
this.scriptProperties.deleteProperty(key);
Expand Down
4 changes: 2 additions & 2 deletions src/JoinTables.js
Original file line number Diff line number Diff line change
Expand Up @@ -528,7 +528,7 @@ class JoinTablesRecordIds {
*
* @param {String} calcField
* @param {String[]} columns
* @returns {TableField}
* @returns {Object}
*/
searchColumnsForTable(calcField, columns) {
let fieldInfo = null;
Expand All @@ -537,7 +537,7 @@ class JoinTablesRecordIds {
for (const col of columns) {
fieldInfo = this.tableFields.getFieldInfo(col);
if (typeof fieldInfo !== 'undefined') {
foundTableField = Object.assign({}, fieldInfo);
foundTableField = {...fieldInfo};
foundTableField.calculatedFormula = calcField;
return foundTableField;
}
Expand Down
2 changes: 1 addition & 1 deletion src/ScriptSettings.js
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ class ScriptSettings { // skipcq: JS-0128
continue;
}

const propertyOfThisApplication = propertyValue !== null && propertyValue.expiry !== undefined;
const propertyOfThisApplication = propertyValue?.expiry !== undefined;

if (propertyOfThisApplication && (PropertyData.isExpired(propertyValue) || deleteAll)) {
this.scriptProperties.deleteProperty(key);
Expand Down
5 changes: 0 additions & 5 deletions src/Select2Object.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,6 @@
import { GasSql } from "./Sql.js";
export { Select2Object };
class Logger {
static log(msg) {
console.log(msg);
}
}
// *** DEBUG END ***/

/**
Expand Down
18 changes: 8 additions & 10 deletions src/Views.js
Original file line number Diff line number Diff line change
Expand Up @@ -480,15 +480,13 @@ class SelectTables {
groupedTableData = this.having(ast.HAVING, groupedTableData);
}
}
else {
// If any conglomerate field functions (SUM, COUNT,...)
// we summarize all records into ONE.
if (this.tableFields.getConglomerateFieldCount() > 0) {
const compressedData = [];
const conglomerate = new ConglomerateRecord(this.tableFields.getSelectFields());
compressedData.push(conglomerate.squish(viewTableData));
groupedTableData = compressedData;
}
// If any conglomerate field functions (SUM, COUNT,...)
// we summarize all records into ONE.
else if (this.tableFields.getConglomerateFieldCount() > 0) {
const compressedData = [];
const conglomerate = new ConglomerateRecord(this.tableFields.getSelectFields());
compressedData.push(conglomerate.squish(viewTableData));
groupedTableData = compressedData;
}

return groupedTableData;
Expand Down Expand Up @@ -2237,7 +2235,7 @@ class AggregateTrack {
* @param {Number} numericData
* @returns {Number}
*/
maxCase(numericData) {
maxCase(numericData) {
this.groupValue = this.first ? numericData : this.groupValue;
this.first = false;
this.groupValue = numericData > this.groupValue ? numericData : this.groupValue;
Expand Down

0 comments on commit 3f33a54

Please sign in to comment.