docs
evals
scenario-1
scenario-2
scenario-3
scenario-4
scenario-5
scenario-6
scenario-7
scenario-8
scenario-9
scenario-10
A utility for merging configuration objects from multiple sources while preserving special object types like custom class instances.
{ database: { host: 'localhost' } } and { database: { port: 5432 } }, merging them produces { database: { host: 'localhost', port: 5432 } } @testDatabaseConnection instance), merging should preserve the instance without attempting to merge its properties @test{ config: { timeout: 30 }, connection: new DatabaseConnection() }), merging with another object should deeply merge plain objects while preserving custom instances @test/**
* Merges multiple configuration objects deeply.
* Plain objects are merged recursively.
* Custom class instances are preserved as-is.
*
* @param {...Object} sources - Configuration objects to merge
* @returns {Object} Merged configuration object
*/
function mergeConfig(...sources) {
// IMPLEMENTATION HERE
}
module.exports = { mergeConfig };Provides deep object merging capabilities with support for custom object handling.