Revision 0.8.4 (#13)
* Parameterized Types * Syntax Options * Documentation
This commit is contained in:
@@ -1,6 +1,10 @@
|
||||
import { TypeBox, Valibot, Zod } from '@sinclair/typemap'
|
||||
|
||||
// TypeScript Syntax Type
|
||||
// Parse Syntax | Parse Value
|
||||
|
||||
const R = Zod('string | number').parse('...') // const R: string | number
|
||||
|
||||
// Syntax Type
|
||||
|
||||
const S = `{
|
||||
x: number,
|
||||
@@ -8,8 +12,6 @@ const S = `{
|
||||
z: number
|
||||
}`
|
||||
|
||||
// Construct Library Types from Syntax
|
||||
|
||||
const T = TypeBox(S) // const T: TObject<{
|
||||
// x: TNumber,
|
||||
// y: TNumber,
|
||||
@@ -29,6 +31,3 @@ const Z = Zod(S) // const Z: ZodObject<{
|
||||
// z: ZodNumber
|
||||
// }, ...>
|
||||
|
||||
// Parse Syntax | Parse Value
|
||||
|
||||
const R = Zod('string | number').parse('...') // const R: string | number
|
||||
Reference in New Issue
Block a user