13 lines
198 B
TypeScript
13 lines
198 B
TypeScript
import { Infer, s } from '.'
|
|
|
|
const res = new s({
|
|
a: s.object({
|
|
p: s.string()
|
|
})
|
|
})
|
|
type Infered = Infer<typeof res>
|
|
|
|
type Test = Infered['a']['p']
|
|
|
|
console.log(res.parse("{ hello: 'world' }"))
|