[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:
Julien Carion (juca)
2025-01-06 12:10:22 +01:00
committed by Michaël Mattiello
parent d3bc101177
commit 17f4823b13
@@ -1931,7 +1931,7 @@
} else if (!isSymbolA && isSymbolB) {
return -1; // Place non-Symbols at the beginning
} else {
return String(a).localeCompare(String(b)); // Sort other keys alphabetically
return String(a).localeCompare(String(b), undefined, { numeric: true }); // Sort other keys alphabetically
}
}