deno.land / x / alosaur@v1.1.1 / examples / validator / models / post.ts

نووسراو ببینە
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
import validator from "https://jspm.dev/class-validator@0.8.5";
const { Length, Contains, IsInt, Min, Max, IsEmail } = validator;
export class PostModel { @Length(10, 20) title?: string;
@Contains("hello") text?: string;
@IsInt() @Min(0) @Max(10) rating?: number;
@IsEmail() email?: string;}
alosaur

Version Info

Tagged at
a year ago