Skip to content
6 changes: 1 addition & 5 deletions lib/server/domain/account-status.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import {
type CredentialRecord,
} from './credentials';
import { getModelsForCredential } from '../proxy/codebuddy';
import { asRecord } from '../shared/content';

export interface AccountStatusSnapshot {
checkin: { claimed: boolean | null; message: string | null };
Expand All @@ -26,11 +27,6 @@ const getBearerToken = (credential: CredentialRecord): string =>
credential.data.bearer_token ?? credential.data.access_token ?? '',
).trim();

const asRecord = (value: unknown): Record<string, unknown> | null =>
value && typeof value === 'object'
? (value as Record<string, unknown>)
: null;

const findValue = (value: unknown, keys: string[]): unknown => {
const record = asRecord(value);
if (record) {
Expand Down
7 changes: 1 addition & 6 deletions lib/server/domain/debug.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import {
trimStorageDebugLogs,
writeStorageJson,
} from '../storage';
import { asRecord } from '../shared/content';

export interface DebugLogEntry {
credentialFilename: string | null;
Expand Down Expand Up @@ -716,12 +717,6 @@ const captureIndependentResponseSnapshot = async (
};
};

const asRecord = (value: unknown): Record<string, unknown> | null => {
return value && typeof value === 'object' && !Array.isArray(value)
? (value as Record<string, unknown>)
: null;
};

const toTokenCount = (value: unknown): number => {
const numeric =
typeof value === 'number' ? value : Number.parseFloat(String(value ?? ''));
Expand Down
Loading
Loading