Skip to content

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

ParameterTypeDescription
errors| LOCConfigValidationError<T>[] | undefinedArray of validation errors to filter
fieldPathFieldPathFilter<T>The field path to filter by (can be partial)

Returns

| LOCConfigValidationError<T>[] | undefined

Array of validation errors that match the field path