import { isObject } from '../../utils/types'

type User = {
    id: number,
    nickname: string,
    regDate: string,
    points: number,
}

type UserResponse = Omit<User, 'regDate'> & { reg_date: string }

const isUserResponse = (obj: unknown): obj is UserResponse => (
    isObject(obj, {
        'id': 'number',
        'nickname': 'string',
        'reg_date': 'string',
        'points': 'number',
    })
)

export type { UserResponse, User }

export { isUserResponse }
