- import type {AssertRule} from "~/types/interfaces";
- export class MaxAssert implements AssertRule {
- supports(key: string): boolean {
- return key === 'max';
- }
- createRule(criteria: number): (value: string) => true | string {
- return (value: string) =>
- value.length <= criteria || `Maximum ${criteria} caractères`;
- }
- }
|