lib/functions/extensionAndFiletype.js
function isPushable(extension, filename, codeExtensions, ignoreRegexes) {

    const fullFilename = `${filename}${extension}`;
    let ignored = false;

    const filenameAndExtensionIsValid = (codeExtensions && codeExtensions.indexOf(extension) > -1 || extension === '.html' || (extension === '.json' && filename === 'appsscript'));

    for (const regex of ignoreRegexes) {
        if (fullFilename.match(regex)) {
            ignored = true;
            break;
        }
    }

    return filenameAndExtensionIsValid && !ignored;
}
function isPushable(extension, filename, codeExtensions, ignoreRegexes) {

    const fullFilename = `${filename}${extension}`;
    let ignored = false;

    const filenameAndExtensionIsValid = (codeExtensions && codeExtensions.indexOf(extension) > -1 || extension === '.html' || (extension === '.json' && filename === 'appsscript'));

    for (const regex of ignoreRegexes) {
        if (fullFilename.match(regex)) {
            ignored = true;
            break;
        }
    }

    return filenameAndExtensionIsValid && !ignored;
}
function isPushable ( extension , filename , codeExtensions , ignoreRegexes ) { const fullFilename = ` ${ filename } ${ extension } ` ; let ignored = false ; const filenameAndExtensionIsValid = ( codeExtensions && codeExtensions . indexOf ( extension ) > - 1 || extension === '.html' || ( extension === '.json' && filename === 'appsscript' ) ) ; for ( const regex of ignoreRegexes ) { if ( fullFilename . match ( regex ) ) { ignored = true ; break ; } } return filenameAndExtensionIsValid && ! ignored ; }
Check if we can push a file to remote

@param {String} extension - The extension of the file we are checking
@param {String} filename - The name without extension of the file we are checking
@param {array} codeExtensions - Array of extensions we should treat as pushable for code files
@param {array} ignoreRegexes - Array of regexes we should ignore
@returns {boolean} - Boolean whether this file is pushable or not
Check if we can push a file to remote