/**
 * Validates if a field value matches another field in the form
 * @param value - The current field value
 * @param formState - The complete form state
 * @param options - Validation options containing the field name to match and optional error message
 * @returns true if valid, error message if invalid
 */
export const validateFieldMatch = (value, formState, options) => {
    const { matchFieldName, errorMessage, matchFieldLabelError } = options;
    if (!matchFieldName)
        return true;
    const targetValue = formState[matchFieldName];
    if (value !== targetValue) {
        return errorMessage ?? `Field must match the ${matchFieldLabelError} field`;
    }
    return true;
};
//# sourceMappingURL=validateFieldMatch.js.map