@@ -30,18 +30,9 @@ export const createSortModifiers = (config: AnyConfig) => {
3030 const isOrderSensitive = modifierWeights . has ( modifier )
3131
3232 if ( isArbitrary || isOrderSensitive ) {
33- // Sort and flush current segment using numeric weights
33+ // Sort and flush current segment alphabetically
3434 if ( currentSegment . length > 0 ) {
35- currentSegment . sort ( ( a , b ) => {
36- const weightA = modifierWeights . get ( a )
37- const weightB = modifierWeights . get ( b )
38- if ( weightA !== undefined && weightB !== undefined ) {
39- return weightA - weightB
40- }
41- if ( weightA !== undefined ) return - 1
42- if ( weightB !== undefined ) return 1
43- return a . localeCompare ( b )
44- } )
35+ currentSegment . sort ( ( a , b ) => a . localeCompare ( b ) )
4536 result . push ( ...currentSegment )
4637 currentSegment = [ ]
4738 }
@@ -54,16 +45,7 @@ export const createSortModifiers = (config: AnyConfig) => {
5445
5546 // Sort and add any remaining segment items
5647 if ( currentSegment . length > 0 ) {
57- currentSegment . sort ( ( a , b ) => {
58- const weightA = modifierWeights . get ( a )
59- const weightB = modifierWeights . get ( b )
60- if ( weightA !== undefined && weightB !== undefined ) {
61- return weightA - weightB
62- }
63- if ( weightA !== undefined ) return - 1
64- if ( weightB !== undefined ) return 1
65- return a . localeCompare ( b )
66- } )
48+ currentSegment . sort ( ( a , b ) => a . localeCompare ( b ) )
6749 result . push ( ...currentSegment )
6850 }
6951
0 commit comments