or run

npx @tessl/cli init
Log in

Version

Files

tile.json

task.mdevals/scenario-10/

Plist Parser with Comments

A utility that parses Apple plist XML documents that may contain XML comments, correctly extracting the data values while ignoring comment content.

Capabilities

Parse plist with comments

Parse plist XML documents that contain XML comments, correctly ignoring the comments and extracting the underlying data.

  • Given a plist XML string <?xml version="1.0"?><plist version="1.0"><!-- comment --><string>test</string></plist>, the parser returns the string "test" @test
  • Given a plist with comments in a string element <?xml version="1.0"?><plist version="1.0"><string>hello<!-- comment -->world</string></plist>, the parser returns "helloworld" @test
  • Given a plist with multiple comments <?xml version="1.0"?><plist version="1.0"><!-- first --><array><integer>1</integer><!-- second --></array></plist>, the parser returns the array [1] @test

Implementation

@generates

API

/**
 * Parses an Apple plist XML string that may contain comments.
 *
 * @param {string} plistXml - The plist XML document as a string.
 * @returns {*} The parsed JavaScript value (object, array, string, number, etc.).
 */
function parsePlist(plistXml) {
  // IMPLEMENTATION HERE
}

module.exports = { parsePlist };

Dependencies { .dependencies }

plist { .dependency }

Provides XML parsing and building capabilities for handling XML documents.

@satisfied-by