Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
// use second file if defined, otherwise the first
var min = results[1] || results[0];
if (err) {
grunt.warn(err);
cb();
return;
}
console.log('\nPath %s', results[0].path.cyan);
// add gzip version to the collection
results.push({
filename: min.filename + '.gz',
current: gzipjs.zip(min.current, {}),
target: gzipjs.zip(min.target, {})
});
grunt.log.writeln('\nSize diff between current branch and ' + target.bold);
results.forEach(function (item) {
var current = item.current.length;
var target = item.target.length;
var diff = current - target;
var percent = ((diff / current) * 100).toFixed();
var color = 'gray';
if (diff > 0) {
color = 'red';
diff = '+' + prettyBytes(diff);
} else if (diff < 0) {
color = 'green';
async.parallel(parallelFns, function (err, results) {
// use second file if defined, otherwise the first
var min = results[1] || results[0];
if (err) {
grunt.warn(err);
cb();
return;
}
console.log('\nPath %s', results[0].path.cyan);
// add gzip version to the collection
results.push({
filename: min.filename + '.gz',
current: gzipjs.zip(min.current, {}),
target: gzipjs.zip(min.target, {})
});
grunt.log.writeln('\nSize diff between current branch and ' + target.bold);
results.forEach(function (item) {
var current = item.current.length;
var target = item.target.length;
var diff = current - target;
var percent = ((diff / current) * 100).toFixed();
var color = 'gray';
if (diff > 0) {
color = 'red';
diff = '+' + prettyBytes(diff);
} else if (diff < 0) {
gzip = function (content) {
// returns an array of bytes
return gzipjs.zip(content, {level: 5});
},
function min_max(min, max) {
var gzip = require('gzip-js');
var gzipSize = String(gzip.zip(min, {}).length);
grunt.log.writeln('Uncompressed size: ' + String(max.length).green + ' bytes.');
grunt.log.writeln('Compressed size: ' + gzipSize.green + ' bytes gzipped (' + String(min.length).green + ' bytes minified).');
}
function min_max(min, max) {
var gzip = require('gzip-js');
var gzipSize = String(gzip.zip(min, {}).length);
grunt.log.writeln('Uncompressed size: ' + String(max.length).green + ' bytes.');
grunt.log.writeln('Compressed size: ' + gzipSize.green + ' bytes gzipped (' + String(min.length).green + ' bytes minified).');
}
function makeLoginOptions(endpointConnectionInfo, token) {
return {
host: endpointConnectionInfo.host,
port: endpointConnectionInfo.port || 443,
path: (endpointConnectionInfo.path || '/') + "rest/com/vmware/cis/session",
method: "POST",
rejectUnauthorized: false,
requestCert: true,
agent: false,
headers: {
'Authorization': makeAuthHeaderValues(base64Encode(gzip.zip(token)))
}
}
}
gz: function (fileContents) {
return require('gzip-js').zip(fileContents, {}).length;
}
}
gz: function( fileContents ) {
return require( "gzip-js" ).zip( fileContents, {}).length;
}
}
gz: function( contents ) {
return gzip.zip(contents, {}).length;
}
},
gz: function(contents) {
return gzip.zip(contents, {}).length;
}
},