Commit 2388e7d
committed
fix: prevent deepMerge from corrupting arrays by treating them as leaf values
P.isObject returns true for arrays, causing deepMerge to spread arrays
into plain objects with numeric keys and recursively merge entries.
This corrupted customModels arrays in ServerSettings whenever
updateSettings was called.
Add Array.isArray guards at both the top-level check and the per-key
recursive branch so arrays are replaced wholesale instead of merged.1 parent c91bd26 commit 2388e7d
File tree
1 file changed
+10
-2
lines changed1 file changed
+10
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
4 | | - | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
5 | 10 | | |
6 | 11 | | |
7 | 12 | | |
| |||
10 | 15 | | |
11 | 16 | | |
12 | 17 | | |
13 | | - | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
14 | 22 | | |
15 | 23 | | |
16 | 24 | | |
| |||
0 commit comments