docs
evals
scenario-1
scenario-10
scenario-2
scenario-3
scenario-4
scenario-5
scenario-6
scenario-7
scenario-8
scenario-9
A utility that sanitizes configuration data by normalizing empty and missing values before converting to property list format.
You are building a configuration management system that needs to handle user-provided data that may contain various empty or missing values. The system should:
The system must handle configuration objects that may contain:
When processing configuration data:
The system must produce valid property list XML that:
/**
* Sanitizes and converts a configuration object to property list XML format.
* Preserves empty strings, arrays, and objects correctly.
*
* @param {Object} config - The configuration object to sanitize
* @returns {string} Property list XML string
*/
function sanitizeConfig(config) {
// IMPLEMENTATION HERE
}
/**
* Parses a property list XML string back into a configuration object.
* Correctly interprets empty elements.
*
* @param {string} xmlString - The property list XML to parse
* @returns {Object} The parsed configuration object
*/
function parseConfig(xmlString) {
// IMPLEMENTATION HERE
}
module.exports = {
sanitizeConfig,
parseConfig
};Provides property list parsing and building support.