mirror of
https://github.com/odoo/owl.git
synced 2025-10-06 19:59:41 +07:00
[FIX] devtools: sort object keys numerically as well
This commit makes the alphabetical sort of object keys account for numerical order as well so that it will feel right when handling objects with numerical keys.
This commit is contained in:
committed by
Michaël Mattiello
parent
d3bc101177
commit
17f4823b13
@@ -1931,7 +1931,7 @@
|
|||||||
} else if (!isSymbolA && isSymbolB) {
|
} else if (!isSymbolA && isSymbolB) {
|
||||||
return -1; // Place non-Symbols at the beginning
|
return -1; // Place non-Symbols at the beginning
|
||||||
} else {
|
} else {
|
||||||
return String(a).localeCompare(String(b)); // Sort other keys alphabetically
|
return String(a).localeCompare(String(b), undefined, { numeric: true }); // Sort other keys alphabetically
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user