chore: port lab6 solution as lab7 base

This commit is contained in:
2026-11-30 16:36:13 +03:00
parent 20afc2c790
commit f736ff1da4
107 changed files with 23433 additions and 0 deletions
+20
View File
@@ -0,0 +1,20 @@
import { registerDecorator, ValidationOptions } from 'class-validator';
export function NotBlank(options?: ValidationOptions) {
return function (object: object, propertyName: string) {
registerDecorator({
name: 'notBlank',
target: object.constructor,
propertyName,
options,
validator: {
validate(value: unknown): boolean {
return typeof value === 'string' && value.trim().length > 0;
},
defaultMessage(): string {
return `${propertyName} must not be empty or whitespace-only`;
},
},
});
};
}