Skip to content
Snippets Groups Projects
Commit 6f6bda36 authored by Thabo Bals's avatar Thabo Bals
Browse files

fixed ordering

parent a27d6811
No related branches found
No related tags found
1 merge request!113Fix old order
Pipeline #284596 passed
......@@ -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)
);
}),
},
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment