Use natural sort

This commit is contained in:
Chocobo1
2023-06-02 17:43:56 +08:00
parent b1492bcd7d
commit 5cea69472f
3 changed files with 13 additions and 16 deletions

View File

@@ -41,6 +41,7 @@ window.qBittorrent.Misc = (function() {
friendlyFloat: friendlyFloat,
parseHtmlLinks: parseHtmlLinks,
escapeHtml: escapeHtml,
naturalSortCollator: naturalSortCollator,
safeTrim: safeTrim,
toFixedPointString: toFixedPointString,
containsAllTerms: containsAllTerms,
@@ -178,6 +179,8 @@ window.qBittorrent.Misc = (function() {
return escapedString;
};
const naturalSortCollator = new Intl.Collator(undefined, { numeric: true, sensitivity: 'base' });
const safeTrim = function(value) {
try {
return value.trim();