typecheck.macro:一个简单(快速)的打字稿验证库宏。 自动为Typescript类型生成验证功能 源码
自动生成 :fire: 炽烈 :fire: Typescript类型的快速验证器。 例子 type Cat < T> = { breed : "tabby" | "siamese" ; isNice : boolean trinket ?: T ; } registerType ( 'Cat' ) // Turned into a validation function at compile time through the power of babel macros // You can also use createDetailedValidator to get error messages const isNumberCat = createValidator < Cat> > ( ) isNumberCat ( { breed : "tabby" , i
下载地址
用户评论