@@ -22,6 +22,9 @@ const maxHeight = /\(\s*max(-device)?-height|\(\s*height\s*<(=)?/i;
22
22
const isMinHeight = _testQuery ( minMaxHeight , maxMinHeight , minHeight ) ;
23
23
const isMaxHeight = _testQuery ( maxMinHeight , minMaxHeight , maxHeight ) ;
24
24
25
+ const lessThan = / < (? ! = ) / ;
26
+ const grtrThan = / > (? ! = ) / ;
27
+
25
28
const isPrint = / p r i n t / i;
26
29
const isPrintOnly = / ^ p r i n t $ / i;
27
30
@@ -202,6 +205,25 @@ module.exports = function createSort(configuration) {
202
205
return - 1 ;
203
206
}
204
207
208
+ if ( lengthA === lengthB ) {
209
+ if ( maxA && maxB ) {
210
+ if ( lessThan . test ( a ) && ! lessThan . test ( b ) ) {
211
+ return 1 ;
212
+ }
213
+ if ( ! lessThan . test ( a ) && lessThan . test ( b ) ) {
214
+ return - 1 ;
215
+ }
216
+ }
217
+ if ( minA && minB ) {
218
+ if ( grtrThan . test ( a ) && ! grtrThan . test ( b ) ) {
219
+ return 1 ;
220
+ }
221
+ if ( ! grtrThan . test ( a ) && grtrThan . test ( b ) ) {
222
+ return - 1 ;
223
+ }
224
+ }
225
+ }
226
+
205
227
return a . localeCompare ( b ) ;
206
228
}
207
229
}
@@ -263,6 +285,25 @@ module.exports = function createSort(configuration) {
263
285
return - 1 ;
264
286
}
265
287
288
+ if ( lengthA === lengthB ) {
289
+ if ( maxA && maxB ) {
290
+ if ( lessThan . test ( a ) && ! lessThan . test ( b ) ) {
291
+ return 1 ;
292
+ }
293
+ if ( ! lessThan . test ( a ) && lessThan . test ( b ) ) {
294
+ return - 1 ;
295
+ }
296
+ }
297
+ if ( minA && minB ) {
298
+ if ( grtrThan . test ( a ) && ! grtrThan . test ( b ) ) {
299
+ return 1 ;
300
+ }
301
+ if ( ! grtrThan . test ( a ) && grtrThan . test ( b ) ) {
302
+ return - 1 ;
303
+ }
304
+ }
305
+ }
306
+
266
307
return - a . localeCompare ( b ) ;
267
308
}
268
309
} ;
0 commit comments