Adjust default argument handling, fix indentation

This commit is contained in:
John Furrow
2016-01-09 12:23:55 -08:00
parent 997d52f2a7
commit 1e21a721a4

View File

@@ -1,7 +1,6 @@
import React from 'react';
const format = {
eta: function(eta) {
if (eta === 'Infinity') {
return '∞';
@@ -69,9 +68,7 @@ const format = {
}
},
data: function(bytes, extraUnits, precision) {
precision = precision || 2;
data: function(bytes, extraUnits, precision = 2) {
let kilobyte = 1024,
megabyte = kilobyte * 1024,
gigabyte = megabyte * 1024,
@@ -99,9 +96,9 @@ const format = {
unit = 'B';
}
if (extraUnits) {
unit += extraUnits;
}
if (extraUnits) {
unit += extraUnits;
}
return {
value,
@@ -121,7 +118,6 @@ const format = {
return ratio.toFixed(precision);
}
};
export default format;