server-ts: Fix errors in becca-interface

This commit is contained in:
Elian Doran
2024-02-17 11:24:50 +02:00
parent 2c0063a5cc
commit 26388ad3b6
4 changed files with 57 additions and 60 deletions

View File

@@ -110,7 +110,7 @@ function getValue<T>(query: string, params: Params = []): T {
// smaller values can result in better performance due to better usage of statement cache
const PARAM_LIMIT = 100;
function getManyRows<T>(query: string, params: Params): T[] | null {
function getManyRows<T>(query: string, params: Params): T[] {
let results: unknown[] = [];
while (params.length > 0) {
@@ -136,7 +136,7 @@ function getManyRows<T>(query: string, params: Params): T[] | null {
results = results.concat(subResults);
}
return results as (T[] | null);
return (results as (T[] | null) || []);
}
function getRows<T>(query: string, params: Params = []): T[] {