docs
evals
scenario-1
scenario-2
scenario-3
scenario-4
scenario-5
scenario-6
scenario-7
scenario-8
scenario-9
scenario-10
Build a utility that merges configuration settings into an existing configuration object. The utility should modify the configuration object in-place rather than creating a new copy, allowing for efficient updates to deeply nested configuration structures.
{ server: { port: 3000 } } and an update { server: { host: 'localhost' } }, calling updateConfig(config, update) modifies the config in-place to become { server: { port: 3000, host: 'localhost' } } @test{ timeout: 1000 } and an update { retries: 3 }, calling updateConfig(config, update) returns a reference to the same config object that now contains both properties @test{ database: { poolSize: 10 } } and an update { database: { poolSize: 20 } }, the original config's poolSize is updated to 20 @test/**
* Merges configuration updates into an existing configuration object in-place.
* The original config object is modified directly and returned.
*
* @param {Object} config - The configuration object to update (will be modified)
* @param {Object} updates - The configuration updates to merge in
* @returns {Object} The modified config object (same reference as input)
*/
function updateConfig(config, updates) {
// Implementation here
}
module.exports = { updateConfig };Provides deep object merging capabilities.