mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-15 21:27:50 +00:00
Cleanup compareAscending and remove hardcoded locale.
This commit is contained in:
@@ -20,12 +20,9 @@ function compareAscending(value, other) {
|
||||
const othIsReflexive = other === other
|
||||
const othIsSymbol = isSymbol(other)
|
||||
|
||||
let val = 0
|
||||
if (typeof value == 'string') {
|
||||
val = value.localeCompare(other,'zh')
|
||||
} else {
|
||||
val = value - other
|
||||
}
|
||||
const val = typeof value == 'string'
|
||||
? value.localeCompare(other)
|
||||
: -other
|
||||
|
||||
if ((!othIsNull && !othIsSymbol && !valIsSymbol && val > 0) ||
|
||||
(valIsSymbol && othIsDefined && othIsReflexive && !othIsNull && !othIsSymbol) ||
|
||||
|
||||
Reference in New Issue
Block a user