UNPKG

decoval

Version:

DecoVal is a decorator-driven validation pattern that allows you to add validation rules directly to the properties of TypeScript classes, simplifying data control and increasing code readability and reusability.

7 lines (6 loc) 222 B
type CustomRule<T> = { validate: (value: T) => boolean; message: string; }; export declare function DvCustom<T = any>(rules: CustomRule<T> | CustomRule<T>[]): (target: any, propertyKey: string) => void; export {};