or run

npx @tessl/cli init
Log in

Version

Files

tile.json

task.mdevals/scenario-8/

Configuration File Converter

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.

Requirements

Configuration to Plist Conversion

Create a function configToPlist that:

  • Accepts a JavaScript configuration object
  • Returns a plist XML string representation
  • Handles nested configuration sections

Plist to Configuration Parsing

Create a function plistToConfig that:

  • Accepts a plist XML string
  • Returns a JavaScript configuration object
  • Properly extracts nested configuration values

Test Cases

  • Converting a flat configuration object {appName: "MyApp", version: "1.0"} to plist and back returns the original object @test
  • Converting a nested configuration object with sections (e.g., {database: {host: "localhost", port: 5432}}) to plist and back preserves the structure @test
  • Parsing a plist with dictionary entries correctly extracts all key-value pairs @test

Implementation

@generates

API

/**
 * 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
};

Dependencies { .dependencies }

plist { .dependency }

Provides plist parsing and building support.