Get linting passing again
This commit is contained in:
parent
4f95f27400
commit
494f66d388
21 changed files with 367 additions and 212 deletions
|
@ -9,15 +9,15 @@ export function formatDate(timestamp) {
|
|||
|
||||
export function formatSize(size) {
|
||||
if (size >= 1073741824) {
|
||||
return Math.round((size / 1073741824) * 10) / 10 + 'GB';
|
||||
return `${Math.round((size / 1073741824) * 10) / 10}GB`;
|
||||
}
|
||||
if (size >= 1048576) {
|
||||
return Math.round((size / 1048576) * 10) / 10 + 'MB';
|
||||
return `${Math.round((size / 1048576) * 10) / 10}MB`;
|
||||
}
|
||||
if (size >= 1024) {
|
||||
return Math.round((size / 1024) * 10) / 10 + 'KB';
|
||||
return `${Math.round((size / 1024) * 10) / 10}KB`;
|
||||
}
|
||||
return Math.round(size) + 'B';
|
||||
return `${Math.round(size)}B`;
|
||||
}
|
||||
|
||||
export function formatFile(file) {
|
||||
|
@ -25,8 +25,8 @@ export function formatFile(file) {
|
|||
added: moment.unix(file.time_added).format(),
|
||||
readableAdded: formatDate(file.time_added),
|
||||
downloads: file.downloads !== undefined ? file.downloads : 0,
|
||||
href: baseURL + '/' + file._id, // eslint-disable-line no-underscore-dangle
|
||||
id: file._id, // eslint-disable-line no-underscore-dangle
|
||||
href: `${baseURL}/${file._id}`,
|
||||
id: file._id,
|
||||
name: file.file_name,
|
||||
size: file.file_size,
|
||||
readableSize: formatSize(file.file_size),
|
||||
|
@ -40,8 +40,8 @@ export function formatFile(file) {
|
|||
formattedFile.width = file.width;
|
||||
const ext = (file.file_name.split('.').pop().toLowerCase() === 'psd' ? '.png' : '');
|
||||
formattedFile.direct = {
|
||||
'150x': baseURL + '/file/150/' + file._id + '/' + file.file_name + ext, // eslint-disable-line no-underscore-dangle
|
||||
'970x': baseURL + '/file/970/' + file._id + '/' + file.file_name + ext, // eslint-disable-line no-underscore-dangle
|
||||
'150x': `${baseURL}/file/150/${file._id}/${file.file_name}${ext}`,
|
||||
'970x': `${baseURL}/file/970/${file._id}/${file.file_name}${ext}`,
|
||||
};
|
||||
}
|
||||
return formattedFile;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue