From 6f6bda36c5ad00017cc266d3ccec4e9d55f87d85 Mon Sep 17 00:00:00 2001
From: Schreipfelerer <Schreipfelerer@gmail.com>
Date: Thu, 8 May 2025 15:38:13 +0200
Subject: [PATCH] fixed ordering

---
 src/index.ts | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/src/index.ts b/src/index.ts
index 203cc1b..dec2453 100644
--- a/src/index.ts
+++ b/src/index.ts
@@ -101,14 +101,19 @@ async function run(inputDir: string, outputDir: string, options: CliOptions) {
 
                     function getNum(x: Resolution) {
                         return parseInt(
-                            x.number.match(/\.(\d+)[PFB]?$/)?.[1],
+                            x.number.match(/\d+\.(\d+)[PBF]?/)?.[1],
                             10,
                         );
                     }
 
+                    function getType(x: Resolution) {
+                        return x.number.match(/\d+\.\d+([PBF]?)/)?.[1];
+                    }
+
                     // This works because `0` and `NaN` are falsy. :)
                     return (
-                        tOrder[b.type] - tOrder[a.type] || getNum(b) - getNum(a)
+                        tOrder[getType(b)] - tOrder[getType(a)]
+                        || getNum(b) - getNum(a)
                     );
                 }),
             },
-- 
GitLab