<commit_before>export default {
    methods: {
        ruleFieldRequired(text) {
            return (v) => (typeof v === 'string' && v.trim()) !== '' || text;
        },
        ruleSelectRequired(text) {
            return (v) => !!v || text;
        },
        ruleSelectMultipleRequired(text) {
            return (v) => (v && v.length > 0) || text;
        },
        ruleToManyChars(text, length) {
            return (v) => (typeof v === 'undefined' || (typeof v === 'string' && v.length <= length)) || text;
        },
        ruleMinLength(text, minLength) {
            return (v) => (typeof v === 'string' && v.trim().length >= minLength) || text;
        },
        rulePasswordChars(text) {
            return (v) => (/(?=.*[A-Z])/.test(v) && /(?=.*[0-9])/.test(v)) || text;
        },
        rulePasswordEquals(text, password) {
            return (v) => v === password || text;
        },
        ruleIsEmail(text) {
            return (v) => /(.+)@(.+){2,}\.(.+){2,}/.test(v) || text;
        },
        isValidYoutubeLink() {
            return (v) => {
                if ((/youtu\.be/i.test(v) || /\.youtube\.com/i.test(v)) && /\/embed\//i.test(v)) {
                    return this.$t("validation:youtubeEmbedUrl")
                } else if (/\.youtube\.com/i.test(v) && !/v=/i.test(v)) {
                    return this.$t("validation:youtubeUrl");
                } else if (/youtu\.be/i.test(v) && !/youtu\.be\/[a-zA-Z0-9]{5,}/i.test(v)) {
                    return this.$t("validation:youtubeUrl");
                }
                return true;
            }
        }
    }
}<commit_msg>Handling null and undefined for ruleToManyChars<commit_after>export default {
    methods: {
        ruleFieldRequired(text) {
            return (v) => (typeof v === 'string' && v.trim()) !== '' || text;
        },
        ruleSelectRequired(text) {
            return (v) => !!v || text;
        },
        ruleSelectMultipleRequired(text) {
            return (v) => (v && v.length > 0) || text;
        },
        ruleToManyChars(text, length) {
            return (v) => (!v || (typeof v === 'string' && v.length <= length)) || text;
        },
        ruleMinLength(text, minLength) {
            return (v) => (typeof v === 'string' && v.trim().length >= minLength) || text;
        },
        rulePasswordChars(text) {
            return (v) => (/(?=.*[A-Z])/.test(v) && /(?=.*[0-9])/.test(v)) || text;
        },
        rulePasswordEquals(text, password) {
            return (v) => v === password || text;
        },
        ruleIsEmail(text) {
            return (v) => /(.+)@(.+){2,}\.(.+){2,}/.test(v) || text;
        },
        isValidYoutubeLink() {
            return (v) => {
                if ((/youtu\.be/i.test(v) || /\.youtube\.com/i.test(v)) && /\/embed\//i.test(v)) {
                    return this.$t("validation:youtubeEmbedUrl")
                } else if (/\.youtube\.com/i.test(v) && !/v=/i.test(v)) {
                    return this.$t("validation:youtubeUrl");
                } else if (/youtu\.be/i.test(v) && !/youtu\.be\/[a-zA-Z0-9]{5,}/i.test(v)) {
                    return this.$t("validation:youtubeUrl");
                }
                return true;
            }
        }
    }
}
{'fraction_non_alphanumeric': 0.2154320987654321, 'fraction_numerical': 0.0049382716049382715, 'mean_word_length': 1.5459544383346426, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 25, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5606980', 'n_tokens_mistral': 1078, 'n_tokens_neox': 1031, 'n_words': 177}