Skip to content

refactor(module): simplify and fix configMerge#4203

Merged
khassel merged 1 commit into
MagicMirrorOrg:developfrom
KristjanESPERANTO:configMerge
Jul 12, 2026
Merged

refactor(module): simplify and fix configMerge#4203
khassel merged 1 commit into
MagicMirrorOrg:developfrom
KristjanESPERANTO:configMerge

Conversation

@KristjanESPERANTO

Copy link
Copy Markdown
Collaborator

I had a hard time understanding configMerge - the old arguments slicing and nested loops took me a while. The jsdoc didn't help much. After it finally clicked, I rewrote it to be readable: rest param + a simple for...of instead of the while-stack.

And there's one real behavior fix. With this default and user config:

defaults: { foo: { a: 1 } }
config:   { foo: [10, 20] }

the old code merged them into { foo: { 0: 10, 1: 20, a: 1 } }. Now the array just replaces the object -> { foo: [10, 20] }.
I added a small test for that case.

Only affects modules using configDeepMerge: true that override an object default with an array, so the impact is tiny.

@khassel khassel merged commit 4a8c119 into MagicMirrorOrg:develop Jul 12, 2026
13 checks passed
@KristjanESPERANTO KristjanESPERANTO deleted the configMerge branch July 12, 2026 22:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants