1.0.2 • Published 4 years ago
type-support v1.0.2
type-support
Get typeguards and casting for free
import { t, getHelpers } from 'type-support'
const user = {
username: t.string,
age: t.number,
info: {
address: t.string,
pets: t.array(t.string)
}
}
type User = typeof user
const [isUser, castToUser] = getHelpers<User>(user)