TooTallNate / plist.js

Mac OS X Plist parser/builder for Node.js and browsers
MIT License
592 stars 123 forks source link

Prevent invalid property list files #98

Closed dnicolson closed 4 years ago

dnicolson commented 4 years ago

This pull request prevents invalid property list files from being created by discarding invalid key/value pairs. Previously keys could be added without values leading to invalid files:

echo '<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
 <dict>
   <key>a</key>
 </dict>
</plist>' | plutil -

<stdin>: Value missing for key inside <dict> at line 6