mirror of
https://github.com/zkldi/Tachi.git
synced 2026-10-10 00:08:22 +03:00
experimental: misc ergonomic checking
This commit is contained in:
@@ -80,7 +80,7 @@ export async function UpdateClassIfGreater(
|
||||
});
|
||||
|
||||
if (isGreater === null) {
|
||||
EmitWebhookEvent({
|
||||
void EmitWebhookEvent({
|
||||
type: "class-update/v1",
|
||||
content: { userID, new: classVal, old: null, set: classSet, game, playtype },
|
||||
});
|
||||
@@ -88,7 +88,7 @@ export async function UpdateClassIfGreater(
|
||||
return null;
|
||||
}
|
||||
|
||||
EmitWebhookEvent({
|
||||
void EmitWebhookEvent({
|
||||
type: "class-update/v1",
|
||||
content: {
|
||||
userID,
|
||||
|
||||
@@ -195,7 +195,7 @@ export async function GetRecentlyAchievedGoals(
|
||||
goalID: { $in: goalSubs.map((e) => e.goalID) },
|
||||
});
|
||||
|
||||
if (goals.length !== goals.length) {
|
||||
if (goals.length !== goalSubs.length) {
|
||||
logger.error(
|
||||
`Found ${goals.length} goals when looking for parents of ${goalSubs.length} subscriptions. This mismatch implies a state desync.`
|
||||
);
|
||||
|
||||
@@ -11,7 +11,10 @@ export function ParseEA3SoftID(ver: string) {
|
||||
|
||||
return {
|
||||
model: a[0],
|
||||
dest: a[1], // region
|
||||
|
||||
// region
|
||||
dest: a[1],
|
||||
|
||||
spec: a[2],
|
||||
rev: a[3],
|
||||
ext: a[4],
|
||||
|
||||
@@ -135,11 +135,11 @@ export function IsValidURL(string: string) {
|
||||
}
|
||||
|
||||
export function Sleep(ms: number) {
|
||||
return new Promise<void>((resolve) =>
|
||||
return new Promise<void>((resolve) => {
|
||||
setTimeout(() => {
|
||||
resolve();
|
||||
}, ms)
|
||||
);
|
||||
}, ms);
|
||||
});
|
||||
}
|
||||
|
||||
export function GetTimeXHoursAgo(hours: integer) {
|
||||
@@ -228,3 +228,7 @@ export function IsSupported(game: Game) {
|
||||
export function ArrayDiff<T>(left: Array<T>, right: Array<T>) {
|
||||
return right.filter((e) => !left.includes(e));
|
||||
}
|
||||
|
||||
export function IsNonEmptyString(maybeStr: string | null | undefined): maybeStr is string {
|
||||
return Boolean(maybeStr);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user