We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent a97df05 commit b8ff77cCopy full SHA for b8ff77c
src/generators/legacy-json/utils/buildSection.mjs
@@ -116,11 +116,11 @@ export const createSectionBuilder = () => {
116
// Only promote certain keys
117
if (!UNPROMOTED_KEYS.includes(key)) {
118
// Merge the section's properties into the parent section
119
- parent[key] = parent[key]
120
- ? // If the parent already has this key, concatenate the values
121
- [].concat(parent[key], value)
122
- : // Otherwise, directly assign the section's value to the parent
123
- [];
+ if (parent[key] && Array.isArray(parent[key])) {
+ parent[key] = parent[key].concat(value);
+ } else {
+ parent[key] ||= value;
+ }
124
}
125
});
126
0 commit comments