Skip to content

Commit c9e84eb

Browse files
committed
style: fix eqeqeq lint warnings in codeManager
Replace == null with === undefined (count is number | undefined, null is impossible) and != null with !== null && !== undefined for the unknown-typed lootDetail parameter. Signed-off-by: Michael Cramer <michael@bigmichi1.de>
1 parent 2d89ab9 commit c9e84eb

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

src/bot/database/codeManager.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ function parseLootEntries(
5050
if (typeof entry !== 'object' || entry === null) continue;
5151
const e = entry as Record<string, unknown>;
5252
const count = typeof e['count'] === 'number' ? e['count'] : undefined;
53-
if (count == null || !Number.isFinite(count) || count <= 0) continue;
53+
if (count === undefined || !Number.isFinite(count) || count <= 0) continue;
5454
if ('chest_type_id' in e && typeof e['chest_type_id'] === 'number') {
5555
const name = CHEST_TYPE_NAMES[e['chest_type_id'] as number] ?? `Chest ${e['chest_type_id']}`;
5656
entries.push({ key: name, type: 'chest', count });
@@ -71,7 +71,7 @@ class CodeManager {
7171
isPublic: boolean = false
7272
): Promise<void> {
7373
const normalizedStatus = normalizeCodeStatus(status);
74-
const lootStr = lootDetail != null ? JSON.stringify(lootDetail) : null;
74+
const lootStr = lootDetail !== null && lootDetail !== undefined ? JSON.stringify(lootDetail) : null;
7575
db.insert(redeemedCodes)
7676
.values({
7777
code,

0 commit comments

Comments
 (0)