docs
evals
scenario-1
scenario-10
scenario-2
scenario-3
scenario-4
scenario-5
scenario-6
scenario-7
scenario-8
scenario-9
Build a simple configuration file converter that transforms JavaScript configuration objects into Apple plist format and vice versa. The converter should handle dictionary/object structures commonly found in application configuration files.
Create a function configToPlist that:
Create a function plistToConfig that:
{appName: "MyApp", version: "1.0"} to plist and back returns the original object @test{database: {host: "localhost", port: 5432}}) to plist and back preserves the structure @test/**
* Converts a configuration object to Apple plist XML format
* @param {Object} config - The configuration object to convert
* @returns {string} Plist XML string
*/
function configToPlist(config) {
// IMPLEMENTATION HERE
}
/**
* Parses a plist XML string into a configuration object
* @param {string} plistXml - The plist XML string to parse
* @returns {Object} Configuration object
*/
function plistToConfig(plistXml) {
// IMPLEMENTATION HERE
}
module.exports = {
configToPlist,
plistToConfig
};Provides plist parsing and building support.