Skip to content

Commit

Permalink
perf(merge-config): optimize mergeConfig performance by avoiding dupl…
Browse files Browse the repository at this point in the history
…icate key visits; (#5679)
  • Loading branch information
DigitalBrainJS committed Apr 25, 2023
1 parent bbb61e7 commit e6f7053
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/core/mergeConfig.js
Expand Up @@ -95,7 +95,7 @@ export default function mergeConfig(config1, config2) {
headers: (a, b) => mergeDeepProperties(headersToObject(a), headersToObject(b), true)
};

utils.forEach(Object.keys(config1).concat(Object.keys(config2)), function computeConfigValue(prop) {
utils.forEach(Object.keys(Object.assign({}, config1, config2)), function computeConfigValue(prop) {
const merge = mergeMap[prop] || mergeDeepProperties;
const configValue = merge(config1[prop], config2[prop], prop);
(utils.isUndefined(configValue) && merge !== mergeDirectKeys) || (config[prop] = configValue);
Expand Down

0 comments on commit e6f7053

Please sign in to comment.