src/libraries/classes/validation-result.class.js
/**
     * Add error and generate error message
     * @param {String} fieldName
     * @param {ValidationRule} validationRule
     */
Add error and generate error message
@param {String} fieldName
@param {ValidationRule} validationRule
Add error and generate error message @param { String } fieldName @param { ValidationRule } validationRule
addError(fieldName, validationRule) {
        this.hasError = true
        if (!this.errorBuckets[fieldName]) {
            this.errorBuckets[fieldName] = [];
        }
        let errorMessage = validationRule.errorMessage || VALIDATION_RULES[validationRule.ruleType].errorMessage
        const replaceableVar = `:${validationRule.ruleType}`
        if (errorMessage.indexOf(replaceableVar) >= 0) {
            errorMessage = errorMessage.replace(replaceableVar, validationRule.additionalValue)
        }
        this.errorBuckets[fieldName].push(errorMessage)
    }
addError ( fieldName , validationRule ) { this . hasError = true if ( ! this . errorBuckets [ fieldName ] ) { this . errorBuckets [ fieldName ] = [ ] ; } let errorMessage = validationRule . errorMessage || VALIDATION_RULES [ validationRule . ruleType ] . errorMessage const replaceableVar = ` ${ validationRule . ruleType } ` if ( errorMessage . indexOf ( replaceableVar ) >= 0 ) { errorMessage = errorMessage . replace ( replaceableVar , validationRule . additionalValue ) } this . errorBuckets [ fieldName ] . push ( errorMessage ) }
Add error and generate error message
 @param {String} fieldName
 @param {ValidationRule} validationRule
Add error and generate error message @param { String } fieldName @param { ValidationRule } validationRule
// generate error message and add it // if it has replaceable variable => replace it (:mix, :max, :lol) // add the error message