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

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

const isUser = (obj: unknown): obj is User => (
    isObject(obj, {
        'id': 'number',
        'name': 'string',
        'regDate': 'number',
        'points': 'number',
    })
)

type UserResponse = User

// const isUserResponse = (obj: unknown): obj is UserResponse => (
//     isObject(obj, {

//     })
// )

const isUserResponse = isUser

export type { UserResponse, User }

export { isUserResponse, isUser }
