remove localeCompare calls
This commit is contained in:
parent
1e0b35d836
commit
43eecb981a
2 changed files with 3 additions and 3 deletions
|
|
@ -40,7 +40,7 @@ export function getClassList(design: DesignSystem): ClassEntry[] {
|
|||
}
|
||||
}
|
||||
|
||||
list.sort((a, b) => a[0].localeCompare(b[0]))
|
||||
list.sort((a, b) => (a[0] === b[0] ? 0 : a[0] < b[0] ? -1 : 1))
|
||||
|
||||
return list
|
||||
}
|
||||
|
|
|
|||
|
|
@ -469,7 +469,7 @@ export function createVariants(theme: Theme): Variants {
|
|||
|
||||
let order =
|
||||
// Compare by bucket name
|
||||
aBucket.localeCompare(zBucket) ||
|
||||
(aBucket === zBucket ? 0 : aBucket < zBucket ? -1 : 1) ||
|
||||
// If bucket names are the same, compare by value
|
||||
(direction === 'asc'
|
||||
? parseInt(aValue) - parseInt(zValue)
|
||||
|
|
@ -489,7 +489,7 @@ export function createVariants(theme: Theme): Variants {
|
|||
// In this scenario, we want to alphabetically sort `calc(100%-1rem)` and
|
||||
// `calc(100%-2rem)` to make it deterministic.
|
||||
if (Number.isNaN(order)) {
|
||||
return aValue.localeCompare(zValue)
|
||||
return aValue < zValue ? -1 : 1
|
||||
}
|
||||
|
||||
return order
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue