/**
 * Mixin for form error checking in checkout components.
 * Provides hasError() to check nested error paths.
 */
export default {
    methods: {
        hasError(path) {
            const parts = path.split('.');
            let obj = this.errors;
            for (const part of parts) {
                if (!obj || typeof obj !== 'object') return false;
                obj = obj[part];
            }
            return !!obj;
        }
    }
};
