API ReferenceValidationFunction
validateNonEmpty()
function validateNonEmpty(raw, field?): Result<string, ValidationError[]>;Validates that a raw value is a non-empty string.
Pure tier-1 validator — no deps, no config, no promises. Safe to call from form onChange handlers
and server-side code alike.
Parameters
| Parameter | Type | Default value | Description |
|---|---|---|---|
raw | unknown | undefined | The value to validate. |
field | string | 'field' | The field name to include in ValidationError. Defaults to 'field'. Pass the actual input name for more descriptive error messages. |
Returns
Result<string,
ValidationError[]>