API ReferenceValidationFunction
getErrorsByFieldPath()
function getErrorsByFieldPath<T>(errors, fieldPath): LOCConfigValidationError<T>[] | undefined;Filters validation errors by field path. This is useful for finding all errors related to a specific field or field hierarchy. If no errors are found, returns undefined.
Type Parameters
| Type Parameter |
|---|
T extends FieldPath |
Parameters
| Parameter | Type | Description |
|---|---|---|
errors | | LOCConfigValidationError<T>[] | undefined | Array of validation errors to filter |
fieldPath | FieldPathFilter<T> | The field path to filter by (can be partial) |
Returns
| LOCConfigValidationError<T>[] | undefined
Array of validation errors that match the field path