Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prebid Core: Add readConfig functionality to clone the config instead of referencing it #7237

Merged
merged 9 commits into from
Sep 8, 2021
4 changes: 2 additions & 2 deletions src/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import { isValidPriceConfig } from './cpmBucketManager.js';
import find from 'core-js-pure/features/array/find.js';
import includes from 'core-js-pure/features/array/includes.js';
import Set from 'core-js-pure/features/set';
import { mergeDeep } from './utils.js';
import { mergeDeep, deepClone } from './utils.js';

const from = require('core-js-pure/features/array/from.js');
const utils = require('./utils.js');
Expand Down Expand Up @@ -312,7 +312,7 @@ export function newConfig() {
return memo;
}, {});
}
return Object.assign({}, config);
return deepClone(config);
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This may not be backwards compatible, should we create either a param to allow to return Object.assign or a separate function so behaviour is explicit in this case?

}

/*
Expand Down