mirror of
https://github.com/zoriya/flood.git
synced 2025-12-21 06:35:14 +00:00
Adjust default argument handling, fix indentation
This commit is contained in:
@@ -1,7 +1,6 @@
|
|||||||
import React from 'react';
|
import React from 'react';
|
||||||
|
|
||||||
const format = {
|
const format = {
|
||||||
|
|
||||||
eta: function(eta) {
|
eta: function(eta) {
|
||||||
if (eta === 'Infinity') {
|
if (eta === 'Infinity') {
|
||||||
return '∞';
|
return '∞';
|
||||||
@@ -69,9 +68,7 @@ const format = {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
data: function(bytes, extraUnits, precision) {
|
data: function(bytes, extraUnits, precision = 2) {
|
||||||
precision = precision || 2;
|
|
||||||
|
|
||||||
let kilobyte = 1024,
|
let kilobyte = 1024,
|
||||||
megabyte = kilobyte * 1024,
|
megabyte = kilobyte * 1024,
|
||||||
gigabyte = megabyte * 1024,
|
gigabyte = megabyte * 1024,
|
||||||
@@ -121,7 +118,6 @@ const format = {
|
|||||||
|
|
||||||
return ratio.toFixed(precision);
|
return ratio.toFixed(precision);
|
||||||
}
|
}
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
export default format;
|
export default format;
|
||||||
|
|||||||
Reference in New Issue
Block a user