feat: refactor utility functions for improved consistency and usability; consolidate parsing logic
This commit is contained in:
@@ -1,10 +1,10 @@
|
||||
import { isRecord } from '@sammo-ts/common';
|
||||
|
||||
export interface WarDexAux {
|
||||
isAttacker?: boolean;
|
||||
opposeType?: { armType: number };
|
||||
}
|
||||
|
||||
const isRecord = (value: unknown): value is Record<string, unknown> => value !== null && typeof value === 'object';
|
||||
|
||||
export const parseWarDexAux = (aux: unknown): WarDexAux => {
|
||||
if (!isRecord(aux)) {
|
||||
return {};
|
||||
|
||||
Reference in New Issue
Block a user