hasMinLength()
const hasMinLength: (value, minLength, fieldName) => string;
Validates that a field meets the minimum length requirement
Parameters
| Parameter | Type | Description |
|---|---|---|
value | string | The input value to validate |
minLength | number | The minimum required length |
fieldName | string | The name of the field for error messages |
Returns
string
Empty string if valid, error message if invalid
Example
hasMinLength("ab", 3, "Username") // Returns: "Username must be at least 3 characters."
hasMinLength("abc", 3, "Username") // Returns: ""