server-ts: Implement review comments

This commit is contained in:
Elian Doran
2024-02-17 18:55:41 +02:00
parent 8af5434462
commit 1e91db865b
5 changed files with 9 additions and 8 deletions

View File

@@ -157,10 +157,10 @@ function iterateRows(query: string, params: Params = []) {
function getMap<K extends string | number | symbol, V>(query: string, params: Params = []) {
const map: Record<K, V> = {} as Record<K, V>;
const results = getRawRows<any>(query, params);
const results = getRawRows<[K, V]>(query, params);
for (const row of results || []) {
map[row[0] as K] = row[1];
map[row[0]] = row[1];
}
return map;