【文件属性】:
文件名称:json-schema-to-ts:根据JSON模式推断TS类型:memo:
文件大小:560KB
文件格式:ZIP
更新时间:2021-02-03 21:32:54
json typescript schema json-schema ts
如果您使用此仓库,请给它加注星标 :sparkles:
停止输入两次 :male_sign_selector:
许多项目使用JSON模式进行运行时数据验证,并使用TypeScript进行静态类型检查。
他们的代码可能如下所示:
const dogSchema = {
type : "object" ,
properties : {
name : { type : "string" } ,
age : { type : "integer" } ,
hobbies : { type : "array" , items : { type : "string" } } ,
favoriteFood : { e