required(input){
        return new Promise((valid, invalid) => {
            if (input.hasAttribute('required')) {
                // input is required, check value
                if (
                    input.getAttribute('type') !== 'file' && input.value === ''
                    || ((input.type === 'radio' || input.type === 'checkbox') && input.validity.valueMissing)
                    || input.getAttribute('type') === 'file' && _bn_getFile(input) === false) {
                    // input is empty or file is not uploaded
                    invalid();
                } else {
                    valid();
                }
            } else {
                valid();
            }
        });
    }
Bunny Form Validation Validators

Each validator is a separate method
Each validator return Promise
Each Promise has valid and invalid callbacks
Invalid callback may contain argument - string of error message or object of additional params for lang error message