@@ -135,6 +135,19 @@ export const numberComparatorBySortOrder = (
135
135
sortOrder : SortingOrder = SortingOrder . ASC ,
136
136
) : number => ( sortOrder === SortingOrder . ASC ? a - b : b - a )
137
137
138
+ export function versionComparatorBySortOrder (
139
+ a : Record < string , any > ,
140
+ b : Record < string , any > ,
141
+ compareKey : string ,
142
+ orderBy : SortingOrder ,
143
+ ) {
144
+ if ( orderBy === SortingOrder . DESC ) {
145
+ return b [ compareKey ] . localeCompare ( a [ compareKey ] , undefined , { numeric : true } )
146
+ }
147
+
148
+ return a [ compareKey ] . localeCompare ( b [ compareKey ] , undefined , { numeric : true } )
149
+ }
150
+
138
151
export const getWebhookEventIcon = ( eventName : WebhookEventNameType ) => {
139
152
switch ( eventName ) {
140
153
case WebhookEventNameType . PULL_REQUEST :
@@ -747,16 +760,3 @@ export const getFileNameFromHeaders = (headers: Headers) =>
747
760
?. find ( ( n ) => n . includes ( 'filename=' ) )
748
761
?. replace ( 'filename=' , '' )
749
762
. trim ( )
750
-
751
- export function versionComparator (
752
- a : Record < string , any > ,
753
- b : Record < string , any > ,
754
- compareKey : string ,
755
- orderBy : SortingOrder ,
756
- ) {
757
- if ( orderBy === SortingOrder . DESC ) {
758
- return b [ compareKey ] . localeCompare ( a [ compareKey ] , undefined , { numeric : true } )
759
- }
760
-
761
- return a [ compareKey ] . localeCompare ( b [ compareKey ] , undefined , { numeric : true } )
762
- }
0 commit comments