fix(api): resolve lint errors

This commit is contained in:
dahyeon committed 2026-07-24 21:52:35 -07:00
1 parent 96fede9fe5
commit fd1fa2366c
42 files changed
+307 -199

No files matched your search

@@ -151,7 +151,7 @@ export class AuctionRedisStateReaderService {
revision: number;
},
shouldForceAuctionStateResync: options.shouldForceAuctionStateResync,
structureState: JSON.parse(structureStateJson) as Record<string, unknown>,
structureState: parseJsonRecord(structureStateJson),
});
view.matchId = matchId;
if (options.includeInternalLiveStateFields) {
@@ -170,12 +170,9 @@ export class AuctionRedisStateReaderService {
if (typeof structureStateJson !== 'string' || !structureStateJson) {
return undefined;
}
const structureState = JSON.parse(structureStateJson) as Record<
string,
unknown
>;
const auctionTeams = Array.isArray(structureState.auctionTeams)
? structureState.auctionTeams
const structureState = parseJsonRecord(structureStateJson);
const auctionTeams: unknown[] = Array.isArray(structureState.auctionTeams)
? (structureState.auctionTeams as unknown[])
: [];
const bidderTeam = auctionTeams.find((entry) => {
if (!entry || typeof entry !== 'object') return false;
@@ -192,6 +189,13 @@ function stringValue(value: unknown): string | undefined {
return typeof value === 'string' && value ? value : undefined;
}
function parseJsonRecord(json: string): Record<string, unknown> {
const value: unknown = JSON.parse(json);
return typeof value === 'object' && value !== null
? (value as Record<string, unknown>)
: {};
}
function parseHashReply(
reply: unknown,
options: { includeInternalLiveStateFields?: boolean } = {},