or run

npx @tessl/cli init
Log in

Version

Files

tile.json

task.mdevals/scenario-9/

Configuration Array Processor

Build a configuration processor that converts structured data arrays between plist XML format and JavaScript objects for a mobile application deployment system.

Requirements

Input Processing

Your system should handle configuration data that contains arrays of deployment targets. Each target includes:

  • A name (string)
  • An enabled status (boolean)
  • A version number (integer or decimal)
  • Optional metadata (nested structures)

Core Functionality

Implement a module that:

  1. Parses plist XML containing arrays into JavaScript objects
  2. Converts JavaScript arrays into plist XML format
  3. Handles nested array structures within the configuration
  4. Supports mixed-type arrays (strings, numbers, booleans, nested objects)

Test Cases

  • Given valid plist XML with an array containing string, integer, and boolean values, parsing returns the correct JavaScript array @test
  • Given a JavaScript array with mixed types, building returns valid plist XML with proper type tags @test
  • Given plist XML with nested arrays, parsing correctly preserves the nested structure @test
  • Given an empty array in JavaScript, building returns plist XML with an empty array element @test

Implementation

@generates

API

/**
 * Parses a plist XML string containing array data and returns JavaScript objects.
 *
 * @param {string} xmlString - The plist XML string to parse
 * @returns {*} The parsed JavaScript value (typically an object or array)
 */
function parseConfig(xmlString) {
  // IMPLEMENTATION HERE
}

/**
 * Converts a JavaScript configuration object to plist XML format.
 *
 * @param {*} config - The JavaScript value to convert (object, array, or primitive)
 * @returns {string} The plist XML string representation
 */
function buildConfig(config) {
  // IMPLEMENTATION HERE
}

module.exports = {
  parseConfig,
  buildConfig
};

Dependencies { .dependencies }

plist { .dependency }

Provides property list parsing and building functionality.