From 17f4823b138caa5a4e1b1275de89051ae298e319 Mon Sep 17 00:00:00 2001 From: "Julien Carion (juca)" Date: Mon, 6 Jan 2025 12:10:22 +0100 Subject: [PATCH] [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. --- tools/devtools/src/page_scripts/owl_devtools_global_hook.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/devtools/src/page_scripts/owl_devtools_global_hook.js b/tools/devtools/src/page_scripts/owl_devtools_global_hook.js index da87b07f..ad9d3922 100644 --- a/tools/devtools/src/page_scripts/owl_devtools_global_hook.js +++ b/tools/devtools/src/page_scripts/owl_devtools_global_hook.js @@ -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 } }