From: Marc Foley Date: Thu, 29 Aug 2024 15:05:48 +0000 (+0100) Subject: tags.html: sort output alphabetically X-Git-Url: http://git.ipfire.org/gitweb/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F8110%2Fhead;p=thirdparty%2Fgoogle%2Ffonts.git tags.html: sort output alphabetically --- diff --git a/.ci/tags.html b/.ci/tags.html index 4ffa2e92e3..20965b6d69 100644 --- a/.ci/tags.html +++ b/.ci/tags.html @@ -188,6 +188,15 @@ }, saveCSV() { this.Families = this.Families.filter((t) => t.Family !== ""); + this.Families = Array.from(this.Families).sort((a, b) => { + if (`${a.Family},${a['Group/Tag']}` < `${b.Family},${b['Group/Tag']}`) { + return -1; + } + if (`${a.Family},${a['Group/Tag']}` > `${b.Family},${b['Group/Tag']}`) { + return 1; + } + return 0; + }); let csv = Papa.unparse(this.Families, { columns: ["Family", "Group/Tag", "Weight"], @@ -207,6 +216,15 @@ }, prCSV() { this.Families = this.Families.filter((t) => t.Family !== ""); + this.Families = Array.from(this.Families).sort((a, b) => { + if (`${a.Family},${a['Group/Tag']}` < `${b.Family},${b['Group/Tag']}`) { + return -1; + } + if (`${a.Family},${a['Group/Tag']}` > `${b.Family},${b['Group/Tag']}`) { + return 1; + } + return 0; + }); let csv = Papa.unparse(this.Families, { columns: ["Family", "Group/Tag", "Weight"],