@uzero/dto
v2.0.0
Published
Input validation decorators
Downloads
699
Readme
dto
Input validation decorators
Exmple
@Dto()
export class Sample {
@Property({ type: 'string', minLength: 3, maxLength: 50 })
stringValue: string;
@Property({ type: 'number', minimum: 0, maximum: 100 })
numberValue: number;
@Property({ type: 'boolean' })
boolean: boolean;
@Property({ type: 'object', target: () => ObjectName })
obj: ObjectName;
@Property({ type: 'date' })
date: Date;
}