Skip to content

Commit

Permalink
Upgrade deps
Browse files Browse the repository at this point in the history
  • Loading branch information
grassick committed Sep 6, 2022
1 parent aa2c4fe commit e1a2f0a
Show file tree
Hide file tree
Showing 13 changed files with 273 additions and 513 deletions.
18 changes: 9 additions & 9 deletions lib/ExprCleaner.js
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ class ExprCleaner {
case "variable":
return this.cleanVariableExpr(expr, cleanOptions);
case "extension":
return extensions_1.getExprExtension(expr.extension).cleanExpr(expr, cleanOptions, this.schema, this.variables);
return (0, extensions_1.getExprExtension)(expr.extension).cleanExpr(expr, cleanOptions, this.schema, this.variables);
// default:
// throw new Error(`Unknown expression type ${expr.type}`)
}
Expand Down Expand Up @@ -223,7 +223,7 @@ class ExprCleaner {
if (expr.exprs.length === 0) {
return null;
}
return immer_1.default(expr, (draft) => {
return (0, immer_1.default)(expr, (draft) => {
for (let i = 0; i < expr.exprs.length; i++) {
draft.exprs[i] = this.cleanExpr(expr.exprs[i], {
types: ["boolean"],
Expand All @@ -241,7 +241,7 @@ class ExprCleaner {
if (expr.exprs.length === 0) {
return null;
}
return immer_1.default(expr, (draft) => {
return (0, immer_1.default)(expr, (draft) => {
for (let i = 0; i < expr.exprs.length; i++) {
draft.exprs[i] = this.cleanExpr(expr.exprs[i], {
types: ["number"],
Expand Down Expand Up @@ -310,7 +310,7 @@ class ExprCleaner {
});
// If ambiguous, just clean subexprs and return
if (opItems.length > 1) {
return immer_1.default(expr, (draft) => {
return (0, immer_1.default)(expr, (draft) => {
for (let i = 0; i < expr.exprs.length; i++) {
// Determine all possible types (union of all op items types)
const types = lodash_1.default.uniq(lodash_1.default.compact(lodash_1.default.flatten(lodash_1.default.map(opItems, (opItem) => opItem.exprTypes[i]))));
Expand All @@ -331,7 +331,7 @@ class ExprCleaner {
}
expr = { type: "op", table: expr.table, op: opItem.op, exprs: [lhsExpr || null] };
}
return immer_1.default(expr, (draft) => {
return (0, immer_1.default)(expr, (draft) => {
// Pad or trim number of expressions
while (draft.exprs.length < opItem.exprTypes.length) {
draft.exprs.push(null);
Expand Down Expand Up @@ -395,7 +395,7 @@ class ExprCleaner {
if (expr.expr) {
const isMultiple = this.exprUtils.isMultipleJoins(expr.table, expr.joins);
const aggrStatuses = isMultiple ? ["literal", "aggregate"] : ["literal", "individual"];
return immer_1.default(expr, (draft) => {
return (0, immer_1.default)(expr, (draft) => {
draft.expr = this.cleanExpr(expr.expr, Object.assign(Object.assign({}, options), { table: innerTable, aggrStatuses }));
});
}
Expand Down Expand Up @@ -429,7 +429,7 @@ class ExprCleaner {
return expr.else || null;
}
// Clean whens as boolean
return immer_1.default(expr, (draft) => {
return (0, immer_1.default)(expr, (draft) => {
for (let c = 0; c < expr.cases.length; c++) {
draft.cases[c].when = this.cleanExpr(expr.cases[c].when, { types: ["boolean"], table: expr.table });
draft.cases[c].then = this.cleanExpr(expr.cases[c].then, options);
Expand All @@ -445,7 +445,7 @@ class ExprCleaner {
return expr;
}
cleanScoreExpr(expr, options) {
return immer_1.default(expr, (draft) => {
return (0, immer_1.default)(expr, (draft) => {
draft.input = this.cleanExpr(expr.input, { types: ["enum", "enumset"] });
// Remove scores if no input
if (!draft.input) {
Expand Down Expand Up @@ -474,7 +474,7 @@ class ExprCleaner {
});
}
cleanBuildEnumsetExpr(expr, options) {
return immer_1.default(expr, (draft) => {
return (0, immer_1.default)(expr, (draft) => {
const enumValueIds = options.enumValueIds;
// Clean values
for (const key in expr.values) {
Expand Down
116 changes: 58 additions & 58 deletions lib/ExprCompiler.js

Large diffs are not rendered by default.

16 changes: 8 additions & 8 deletions lib/ExprUtils.js
Original file line number Diff line number Diff line change
Expand Up @@ -277,7 +277,7 @@ class ExprUtils {
return ((_a = lodash_1.default.findWhere(this.variables, { id: expr.variableId })) === null || _a === void 0 ? void 0 : _a.enumValues) || null;
}
if (expr.type == "extension") {
return extensions_1.getExprExtension(expr.extension).getExprEnumValues(expr, this.schema, this.variables);
return (0, extensions_1.getExprExtension)(expr.extension).getExprEnumValues(expr, this.schema, this.variables);
}
return null;
}
Expand Down Expand Up @@ -311,7 +311,7 @@ class ExprUtils {
return ((_a = lodash_1.default.findWhere(this.variables, { id: expr.variableId })) === null || _a === void 0 ? void 0 : _a.idTable) || null;
}
if (expr.type == "extension") {
return extensions_1.getExprExtension(expr.extension).getExprIdTable(expr, this.schema, this.variables);
return (0, extensions_1.getExprExtension)(expr.extension).getExprIdTable(expr, this.schema, this.variables);
}
return null;
}
Expand Down Expand Up @@ -383,7 +383,7 @@ class ExprUtils {
}
return variable.type;
case "extension":
return extensions_1.getExprExtension(expr.extension).getExprType(expr, this.schema, this.variables);
return (0, extensions_1.getExprExtension)(expr.extension).getExprType(expr, this.schema, this.variables);
default:
// TODO remove
if (expr.type == "count") {
Expand Down Expand Up @@ -471,7 +471,7 @@ class ExprUtils {
}
return "literal";
case "extension":
return extensions_1.getExprExtension(expr.extension).getExprAggrStatus(expr, this.schema, this.variables);
return (0, extensions_1.getExprExtension)(expr.extension).getExprAggrStatus(expr, this.schema, this.variables);
// default:
// throw new Error(`Not implemented for ${expr.type}`);
}
Expand Down Expand Up @@ -651,7 +651,7 @@ class ExprUtils {
var variable = lodash_1.default.findWhere(this.variables, { id: expr.variableId });
return variable ? this.localizeString(variable.name, locale) || "" : "";
case "extension":
return extensions_1.getExprExtension(expr.extension).summarizeExpr(expr, locale, this.schema, this.variables);
return (0, extensions_1.getExprExtension)(expr.extension).summarizeExpr(expr, locale, this.schema, this.variables);
default:
throw new Error(`Unsupported type ${expr.type}`);
}
Expand Down Expand Up @@ -751,9 +751,9 @@ class ExprUtils {
}
return value.join(", ");
case "date":
return moment_1.default(value, moment_1.default.ISO_8601).format("ll");
return (0, moment_1.default)(value, moment_1.default.ISO_8601).format("ll");
case "datetime":
return moment_1.default(value, moment_1.default.ISO_8601).format("lll");
return (0, moment_1.default)(value, moment_1.default.ISO_8601).format("lll");
}
if (value === true) {
return "True";
Expand Down Expand Up @@ -892,7 +892,7 @@ class ExprUtils {
}
break;
case "extension":
cols = cols.concat(extensions_1.getExprExtension(expr.extension).getReferencedFields(expr, this.schema, this.variables));
cols = cols.concat((0, extensions_1.getExprExtension)(expr.extension).getReferencedFields(expr, this.schema, this.variables));
break;
}
return lodash_1.default.uniq(cols, (col) => col.table + "/" + col.column);
Expand Down
2 changes: 1 addition & 1 deletion lib/ExprValidator.js
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ class ExprValidator {
}
break;
case "extension":
const err = extensions_1.getExprExtension(expr.extension).validateExpr(expr, options, this.schema, this.variables);
const err = (0, extensions_1.getExprExtension)(expr.extension).validateExpr(expr, options, this.schema, this.variables);
if (err) {
return err;
}
Expand Down
2 changes: 1 addition & 1 deletion lib/MWaterDataSource.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,6 @@ export default class MWaterDataSource extends DataSource {
performQuery(query: JsonQLQuery): Promise<Row[]>;
performQuery(query: JsonQLQuery, cb: (error: any, rows: Row[]) => void): void;
getCacheExpiry(): number;
clearCache(): number;
clearCache(): void;
getImageUrl(imageId: any, height: any): string;
}
2 changes: 1 addition & 1 deletion lib/MWaterDataSource.js
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ class MWaterDataSource extends DataSource_1.default {
var _a;
(_a = this.cache) === null || _a === void 0 ? void 0 : _a.reset();
// Set new cache expiry
return (this.cacheExpiry = new Date().getTime());
this.cacheExpiry = new Date().getTime();
}
// Get the url to download an image (by id from an image or imagelist column)
// Height, if specified, is minimum height needed. May return larger image
Expand Down
2 changes: 1 addition & 1 deletion lib/PriorityDataQueue.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ class PriorityDataQueue {
return dataSource.performQuery(query, callback);
});
};
this.performQueryPriorityQueue = async_1.priorityQueue(worker, concurrency);
this.performQueryPriorityQueue = (0, async_1.priorityQueue)(worker, concurrency);
}
// Creates a PriorityDataSource that will then be used like a DataSource but with a priority
createPriorityDataSource(priority) {
Expand Down
Loading

0 comments on commit e1a2f0a

Please sign in to comment.