Code styling changes to pass grunt prod

feature-extract-files
toby 2017-02-09 11:38:20 -05:00
parent e751825a49
commit c67957da81
2 changed files with 15 additions and 15 deletions

View File

@ -980,7 +980,7 @@ var Utils = {
var Utils = this; var Utils = this;
var html = ""; var html = "";
files.forEach(function(file, i) { files.forEach(function(file, i) {
if(typeof file.contents !== "undefined") { if (typeof file.contents !== "undefined") {
html += formatFile(file, i); html += formatFile(file, i);
} else { } else {
html += formatDirectory(file); html += formatDirectory(file);

View File

@ -377,7 +377,7 @@ var Compress = {
}; };
var padLeft = function(string, length, padChar) { var padLeft = function(string, length, padChar) {
while(string.length < length) { while (string.length < length) {
string = padChar + string; string = padChar + string;
} }
return string; return string;
@ -397,12 +397,12 @@ var Compress = {
Tarball.prototype.writeBytes = function(bytes) { Tarball.prototype.writeBytes = function(bytes) {
var self = this; var self = this;
if(this.position + bytes.length > this.bytes.length) { if (this.position + bytes.length > this.bytes.length) {
this.addEmptyBlock(); this.addEmptyBlock();
} }
Array.prototype.forEach.call(bytes, function(b, i) { Array.prototype.forEach.call(bytes, function(b, i) {
if(typeof b.charCodeAt !== "undefined") { if (typeof b.charCodeAt !== "undefined") {
b = b.charCodeAt(); b = b.charCodeAt();
} }
@ -413,7 +413,7 @@ var Compress = {
Tarball.prototype.writeEndBlocks = function() { Tarball.prototype.writeEndBlocks = function() {
var numEmptyBlocks = 2; var numEmptyBlocks = 2;
for(var i = 0; i < numEmptyBlocks; i++) { for (var i = 0; i < numEmptyBlocks; i++) {
this.addEmptyBlock(); this.addEmptyBlock();
} }
}; };
@ -442,10 +442,10 @@ var Compress = {
}; };
var checksum = 0; var checksum = 0;
for(var key in file) { for (var key in file) {
var bytes = file[key]; var bytes = file[key];
Array.prototype.forEach.call(bytes, function(b) { Array.prototype.forEach.call(bytes, function(b) {
if(typeof b.charCodeAt !== "undefined") { if (typeof b.charCodeAt !== "undefined") {
checksum += b.charCodeAt(); checksum += b.charCodeAt();
} else { } else {
checksum += b; checksum += b;
@ -497,9 +497,9 @@ var Compress = {
Stream.prototype.readString = function(numBytes) { Stream.prototype.readString = function(numBytes) {
var result = ""; var result = "";
for(var i = this.position; i < this.position + numBytes; i++) { for (var i = this.position; i < this.position + numBytes; i++) {
var currentByte = this.bytes[i]; var currentByte = this.bytes[i];
if(currentByte === 0) break; if (currentByte === 0) break;
result += String.fromCharCode(currentByte); result += String.fromCharCode(currentByte);
} }
this.position += numBytes; this.position += numBytes;
@ -518,7 +518,7 @@ var Compress = {
var stream = new Stream(input), var stream = new Stream(input),
files = []; files = [];
while(stream.hasMore()) { while (stream.hasMore()) {
var dataPosition = stream.position + 512; var dataPosition = stream.position + 512;
var file = { var file = {
@ -534,7 +534,7 @@ var Compress = {
USTARFormat: stream.readString(6).indexOf("ustar") >= 0, USTARFormat: stream.readString(6).indexOf("ustar") >= 0,
}; };
if(file.USTARFormat) { if (file.USTARFormat) {
file.version = stream.readString(2); file.version = stream.readString(2);
file.ownerUserName = stream.readString(32); file.ownerUserName = stream.readString(32);
file.ownerGroupName = stream.readString(32); file.ownerGroupName = stream.readString(32);
@ -545,20 +545,20 @@ var Compress = {
stream.position = dataPosition; stream.position = dataPosition;
if(file.type === "0") { if (file.type === "0") {
// File // File
files.push(file); files.push(file);
var endPosition = stream.position + file.size; var endPosition = stream.position + file.size;
if(file.size % 512 !== 0) { if (file.size % 512 !== 0) {
endPosition += 512 - (file.size % 512); endPosition += 512 - (file.size % 512);
} }
file.contents = ""; file.contents = "";
while(stream.position < endPosition) { while (stream.position < endPosition) {
file.contents += stream.readString(512); file.contents += stream.readString(512);
} }
} else if(file.type === "5") { } else if (file.type === "5") {
// Directory // Directory
files.push(file); files.push(file);
} else { } else {