lib/modes.js
function _minFile(rawFile, compressedFile) {
    if (compressedFile.size < rawFile.size) {
        return qfs.move(compressedFile.name, rawFile.name)
            .then(function () {
                return new File(rawFile.name, compressedFile.size);
            });
    }

    return compressedFile.remove()
        .then(function () {
            return rawFile;
        });
}
function _minFile(rawFile, compressedFile) {
    if (compressedFile.size < rawFile.size) {
        return qfs.move(compressedFile.name, rawFile.name)
            .then(function () {
                return new File(rawFile.name, compressedFile.size);
            });
    }

    return compressedFile.remove()
        .then(function () {
            return rawFile;
        });
}
function _minFile ( rawFile , compressedFile ) { if ( compressedFile . size < rawFile . size ) { return qfs . move ( compressedFile . name , rawFile . name ) . then ( function ( ) { return new File ( rawFile . name , compressedFile . size ) ; } ) ; } return compressedFile . remove ( ) . then ( function ( ) { return rawFile ; } ) ; }
Overwrites the raw file by the compressed one if it is smaller otherwise removes it
@param {File} rawFile
@param {File} compressedFile
@returns {Promise * File}
Overwrites the raw file by the compressed one if it is smaller otherwise removes it