cosmetic changes (#13820)

* cosmetic changes

* moved limitLongName function to the utils
This commit is contained in:
Vladimir Chernov
2020-12-16 23:11:49 +03:00
committed by GitHub
parent 94a777b23f
commit 2abc11a1c7
5 changed files with 47 additions and 23 deletions

View File

@@ -96,3 +96,12 @@ export function htmlEscape(html: string): string {
function escapeFileName(str: string): string {
return str.replace(/\*/g, '_');
}
export function limitLongName(name: string, maxLength: number): string {
if (name.length > maxLength) {
return name.slice(0, maxLength) + '...';
}
return name;
}