@tkrjs/validator
v1.0.0-beta.1.3
Published
[![npm (scoped)](https://img.shields.io/npm/v/@tkrjs/core.svg)](https://www.npmjs.com/package/@tkrjs/validator)
Downloads
8
Readme
@tkrjs/validator
介绍
此模块用于在 @tkrjs/core
项目中,处理数据的类型验证。
演示
import { Controller, Get, Body, Session, Response, Database, TKServer, Post, HttpException } from "@tkrjs/core";
import { VRequired, VString, VEmail, VMobilePhone } from '@tkrjs/validator'
@Controller('/')
export class IndexController {
@Get
private async index(
@Body({
account: [ VString, VEmail, VMobilePhone, VRequired ],
password: [VString, VRequired],
verifiy: [VString, VRequired]
})
body: TKServer.Validator<LoginData>
) {
console.log(body.data)
}
}