docs
evals
scenario-1
scenario-10
scenario-2
scenario-3
scenario-4
scenario-5
scenario-6
scenario-7
scenario-8
scenario-9
Build a configuration file parser for a cross-platform mobile app that reads Apple plist XML configuration files and extracts structured data for use in the application.
Your task is to implement a configuration parser that:
/**
* Parses an XML plist configuration file and returns a JavaScript object.
*
* @param {string} xmlContent - The XML plist content as a string
* @returns {Object} The parsed configuration object
* @throws {Error} If the XML is malformed or invalid
*/
function parseConfig(xmlContent) {
// IMPLEMENTATION HERE
}
/**
* Extracts a specific configuration value from a parsed config object.
*
* @param {Object} config - The parsed configuration object
* @param {string} key - The configuration key to extract
* @returns {*} The value associated with the key, or undefined if not found
*/
function getConfigValue(config, key) {
// IMPLEMENTATION HERE
}
module.exports = {
parseConfig,
getConfigValue
};Provides XML plist parsing capabilities for converting Apple property list files to JavaScript objects.