pure-parse
v0.0.0-beta.7
Published
Strongly typed validation library that decouples type aliases from validation logic
Downloads
7,612
Maintainers
Readme
Declare the type:
type User = {
id: number
name: string
}
const parseUser = object<User>({
id: parseNumber,
name: parseString,
})
...or infer the type:
const parseUser = object({
id: parseNumber,
name: parseString,
})
type User = Infer<typeof parseUser>