The Rock
Results
1
issues of
The Rock
一般写ts的时候会先申明一个interface(这个interface只能够解决ts编译前的校验),可以利用这个interface来生成rule,校验运行时的参数,比如对一个request做参数校验: ``` interface ParamRequest { id: number, page: string, hehe: boolean, haha: Array, } let rule: ParamRequest; const param: ParamRequest = this.request.body; const isError = this.validate.validator(rule, param); ```