server-ts: Port ws service & dependencies

This commit is contained in:
Elian Doran
2024-02-17 01:51:47 +02:00
parent 4b1d2c6bad
commit cf18e61a33
11 changed files with 108 additions and 53 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(query: string, params: Params) {
function getManyRows<T>(query: string, params: Params): T[] | null {
let results: unknown[] = [];
while (params.length > 0) {
@@ -136,7 +136,7 @@ function getManyRows(query: string, params: Params) {
results = results.concat(subResults);
}
return results;
return results as (T[] | null);
}
function getRows<T>(query: string, params: Params = []): T[] {