@kfiross44/valtio-inspector 0.9.3 → 0.9.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/client/app.js +8 -2
- package/package.json +1 -1
package/client/app.js
CHANGED
|
@@ -84,7 +84,9 @@ function storeColor(name) {
|
|
|
84
84
|
|
|
85
85
|
function renderSidebar() {
|
|
86
86
|
const list = document.getElementById('store-list')
|
|
87
|
-
|
|
87
|
+
// Sort stores alphabetically
|
|
88
|
+
const stores = Object.keys(stateTree).sort((a, b) => a.localeCompare(b))
|
|
89
|
+
|
|
88
90
|
|
|
89
91
|
if (stores.length === 0) {
|
|
90
92
|
list.innerHTML = ''
|
|
@@ -209,7 +211,11 @@ function buildNode(parent, value, key, path, depth) {
|
|
|
209
211
|
if (!collapsed) {
|
|
210
212
|
const kids = document.createElement('div')
|
|
211
213
|
kids.className = 'json-children'
|
|
212
|
-
|
|
214
|
+
// Sort the keys alphabetically before mapping to buildNode
|
|
215
|
+
const keys = Object.keys(value).sort((a, b) => a.localeCompare(b))
|
|
216
|
+
|
|
217
|
+
for (const k2 of keys) {
|
|
218
|
+
const v2 = value[k2]
|
|
213
219
|
buildNode(kids, v2, k2, `${path}.${k2}`, depth + 1)
|
|
214
220
|
}
|
|
215
221
|
parent.appendChild(kids)
|