style:lint
This commit is contained in:
1 parent
5685605731
commit
05ab077521
11 files changed
+58
-70
No files matched your search
@@ -3,8 +3,28 @@ import fs from 'fs';
|
||||
import os from 'node:os';
|
||||
import { QQLevel } from '@/core';
|
||||
|
||||
//下面这个类是用于将uid+msgid合并的类
|
||||
export async function solveProblem<T extends (...arg: any[]) => any>(func: T): Promise<ReturnType<T> | undefined> {
|
||||
return new Promise<ReturnType<T> | undefined>(async (resolve) => {
|
||||
try {
|
||||
const result = func();
|
||||
resolve(result);
|
||||
} catch (e) {
|
||||
resolve(undefined);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
export async function solveAsyncProblem<T extends (...arg: any[]) => Promise<any>>(func: T): Promise<Awaited<ReturnType<T>> | undefined> {
|
||||
return new Promise<Awaited<ReturnType<T>> | undefined>(async (resolve) => {
|
||||
try {
|
||||
const result = await func();
|
||||
resolve(result);
|
||||
} catch (e) {
|
||||
resolve(undefined);
|
||||
}
|
||||
});
|
||||
}
|
||||
//下面这个类是用于将uid+msgid合并的类
|
||||
export class UUIDConverter {
|
||||
static encode(highStr: string, lowStr: string): string {
|
||||
const high = BigInt(highStr);
|
||||
|
||||
Reference in new issue
Block a user