Update typescript to 4.8.4

This commit is contained in:
Fedor Indutny 2022-11-14 11:35:37 -08:00 committed by GitHub
parent 4c622b6f81
commit e6ebfe4fca
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
15 changed files with 133 additions and 167 deletions

View file

@ -355,7 +355,10 @@ type DatabaseQueryCache = Map<string, Statement<Array<unknown>>>;
const statementCache = new WeakMap<Database, DatabaseQueryCache>();
function prepare<T>(db: Database, query: string): Statement<T> {
function prepare<T extends Array<unknown> | Record<string, unknown>>(
db: Database,
query: string
): Statement<T> {
let dbCache = statementCache.get(db);
if (!dbCache) {
dbCache = new Map();

View file

@ -174,7 +174,13 @@ export class MainSQL {
throw new Error('Not initialized');
}
const { result, duration } = await this.send({
type SqlCallResult = Readonly<{
// eslint-disable-next-line @typescript-eslint/no-explicit-any
result: any;
duration: number;
}>;
const { result, duration } = await this.send<SqlCallResult>({
type: 'sqlCall',
method,
args,