examples/validation/dist/index.js
function _bn_getFile(input) {
    // if there is custom file upload logic, for example, images are resized client-side
    // generated Blobs should be assigned to fileInput._file
    // and can be sent via ajax with FormData

    // if file was deleted, custom field can be set to an empty string

    // Bunny Validation detects if there is custom Blob assigned to file input
    // and uses this file for validation instead of original read-only input.files[]
    if (input._file !== undefined && input._file !== '') {
        if (input._file instanceof Blob === false) {
            console.error("Custom file for input " + input.name + " is not an instance of Blob");
            return false;
        }
        return input._file;
    }
    return input.files[0] || false;
}
function _bn_getFile(input) {
    // if there is custom file upload logic, for example, images are resized client-side
    // generated Blobs should be assigned to fileInput._file
    // and can be sent via ajax with FormData

    // if file was deleted, custom field can be set to an empty string

    // Bunny Validation detects if there is custom Blob assigned to file input
    // and uses this file for validation instead of original read-only input.files[]
    if (input._file !== undefined && input._file !== '') {
        if (input._file instanceof Blob === false) {
            console.error("Custom file for input " + input.name + " is not an instance of Blob");
            return false;
        }
        return input._file;
    }
    return input.files[0] || false;
}
function _bn_getFile ( input ) { // if there is custom file upload logic, for example, images are resized client-side // generated Blobs should be assigned to fileInput._file // and can be sent via ajax with FormData // if file was deleted, custom field can be set to an empty string // Bunny Validation detects if there is custom Blob assigned to file input // and uses this file for validation instead of original read-only input.files[] if ( input . _file !== undefined && input . _file !== '' ) { if ( input . _file instanceof Blob === false ) { console . error ( "Custom file for input " + input . name + " is not an instance of Blob" ) ; return false ; } return input . _file ; } return input . files [ 0 ] || false ; }
Bunny Validation helper - get file to validate
@param {HTMLInputElement} input
@returns {File|Blob|boolean} - If no file uploaded - returns false
@private
Bunny Validation helper - get file to validate