流利的JSON验证器 一个易于使用,可表达且可组合的JSON对象验证器,具有流畅的构建器模式界面! // this is what you want to validate: // coming from the user, read from a file, sent back by some API, etc. const person = { name : 'John Doe' , age : 42 , hobbies : [ 'eating' , 'coding' , 'sleeping' ] , favoriteNumberOrColor : 'green' } ; // this is the structure you want your data to have: const personSchema = is . Object ( {