Improved deep equality testing for Node.js and the browser with support for complex types and circular references.
Overall
score
96%
Build a utility that compares configuration objects to determine if they are deeply equal.
Create a module that exports a compareConfigs function which:
config1 and config2 (both plain objects)The function should correctly handle:
{port: 3000, host: "localhost"} with {port: 3000, host: "localhost"} returns true @test{port: 3000, host: "localhost"} with {host: "localhost", port: 3000} returns true @test{server: {port: 3000}} with {server: {port: 8080}} returns false @test{} with {} returns true @test@generates
/**
* Compares two configuration objects for deep equality.
*
* @param {Object} config1 - The first configuration object
* @param {Object} config2 - The second configuration object
* @returns {boolean} True if configurations are deeply equal, false otherwise
*/
function compareConfigs(config1, config2) {
// Implementation here
}
module.exports = { compareConfigs };Provides deep equality comparison for configuration objects.
Install with Tessl CLI
npx tessl i tessl/npm-deep-eqldocs
evals
scenario-1
scenario-2
scenario-3
scenario-4
scenario-5
scenario-6
scenario-7
scenario-8
scenario-9
scenario-10