193
return this;
194
}
196
>
const contents: IStringDictionary<unknown> = {};
197
>
for (const key of arrays.distinct([...Object.keys(this.contents), ...Object.keys(overrideContents)])) {
198
>
199
>
let contentsForKey = this.contents[key];
200
>
const overrideContentsForKey = overrideContents[key];
201
>
202
>
// If there are override contents for the key, clone and merge otherwise use base contents
203
>
if (overrideContentsForKey) {
204
>
// Clone and merge only if base contents and override contents are of type object otherwise just override
205
>
if (typeof contentsForKey === 'object' && typeof overrideContentsForKey === 'object') {
206
contentsForKey = objects.deepClone(contentsForKey);
207
this.mergeContents(contentsForKey as IStringDictionary<unknown>, overrideContentsForKey as IStringDictionary<unknown>);
209
contentsForKey = overrideContentsForKey;
210
}
212
>
213
>
contents[key] = contentsForKey;
214
>
}
215
>
216
>
return new ConfigurationModel(contents, this.keys, this.overrides, undefined, this.logService);
217
}
218