lib/storage/azure.js
function(gzipEncoding) {
      var gzipSettings = gzipEncoding || {};
      var { whitelist, blacklist } = Object.keys(gzipSettings).reduce((prev, key) => {
        if (gzipSettings[key]) {
          prev['whitelist'].push(key);
        } else {
          prev['blacklist'].push(key);
        }
        return prev;
      }, { whitelist: [], blacklist: [] });

      // @NOTE - we REMOVE whitelisted types from the blacklist array
      var gzipBlacklist = defaultGzipBlacklist.concat(blacklist).filter(el => whitelist.indexOf(el));

      return _.uniq(gzipBlacklist);
    }
function(gzipEncoding) {
      var gzipSettings = gzipEncoding || {};
      var { whitelist, blacklist } = Object.keys(gzipSettings).reduce((prev, key) => {
        if (gzipSettings[key]) {
          prev['whitelist'].push(key);
        } else {
          prev['blacklist'].push(key);
        }
        return prev;
      }, { whitelist: [], blacklist: [] });

      // @NOTE - we REMOVE whitelisted types from the blacklist array
      var gzipBlacklist = defaultGzipBlacklist.concat(blacklist).filter(el => whitelist.indexOf(el));

      return _.uniq(gzipBlacklist);
    }
function ( gzipEncoding ) { var gzipSettings = gzipEncoding || { } ; var { whitelist , blacklist } = Object . keys ( gzipSettings ) . reduce ( ( prev , key ) => { if ( gzipSettings [ key ] ) { prev [ 'whitelist' ] . push ( key ) ; } else { prev [ 'blacklist' ] . push ( key ) ; } return prev ; } , { whitelist : [ ] , blacklist : [ ] } ) ; // @NOTE - we REMOVE whitelisted types from the blacklist array var gzipBlacklist = defaultGzipBlacklist . concat ( blacklist ) . filter ( el => whitelist . indexOf ( el ) ) ; return _ . uniq ( gzipBlacklist ) ; }
Use sane defaults and user config to get array of file extensions to avoid gzipping
@param gzipEncoding {Object} ex: {jpg: true, rando: false}
@retyrb {Array} An array of file extensions to ignore
Use sane defaults and user config to get array of file extensions to avoid gzipping