mirror of
https://github.com/zadam/trilium.git
synced 2025-11-03 03:46:37 +01:00
always use template strings instead of string concatenation
This commit is contained in:
@@ -191,9 +191,9 @@ function formatDownloadTitle(filename, type, mime) {
|
||||
filename = sanitize(filename);
|
||||
|
||||
if (type === 'text') {
|
||||
return filename + '.html';
|
||||
return `${filename}.html`;
|
||||
} else if (['relationMap', 'canvas', 'search'].includes(type)) {
|
||||
return filename + '.json';
|
||||
return `${filename}.json`;
|
||||
} else {
|
||||
if (!mime) {
|
||||
return filename;
|
||||
@@ -208,7 +208,7 @@ function formatDownloadTitle(filename, type, mime) {
|
||||
}
|
||||
|
||||
for (const ext of extensions) {
|
||||
if (filenameLc.endsWith('.' + ext)) {
|
||||
if (filenameLc.endsWith(`.${ext}`)) {
|
||||
return filename;
|
||||
}
|
||||
}
|
||||
@@ -221,7 +221,7 @@ function formatDownloadTitle(filename, type, mime) {
|
||||
return filename;
|
||||
}
|
||||
|
||||
return filename + '.' + extensions[0];
|
||||
return `${filename}.${extensions[0]}`;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user