Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: TooTallNate/plist.js
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 69520574f27864145192338b72e608fbe1bda6f7
Choose a base ref
...
head repository: TooTallNate/plist.js
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 276c65742b138de3a80fa2a5e80bf74352e1a2a3
Choose a head ref

Commits on Dec 25, 2015

  1. add verbose examples

    mrzmyr committed Dec 25, 2015
    Copy the full SHA
    a88aa4d View commit details

Commits on Jan 26, 2016

  1. #66 - fixed empty key

    Andrew Goldis committed Jan 26, 2016
    Copy the full SHA
    421c7f2 View commit details
  2. #66 - fixed empty keys and added tests

    Andrew Goldis committed Jan 26, 2016
    Copy the full SHA
    f360d7d View commit details

Commits on Feb 22, 2016

  1. Fix Cannot read property 'nodeValue' of undefined exception that is t…

    …hrown when a <key></key> construct appears in plist
    chriskinsman committed Feb 22, 2016
    Copy the full SHA
    4afb7c5 View commit details

Commits on Feb 23, 2016

  1. Merge pull request #70 from chriskinsman/master

    Fix Cannot read property 'nodeValue' of undefined exception that is t…
    mreinstein committed Feb 23, 2016
    Copy the full SHA
    6daf4cc View commit details

Commits on Mar 13, 2016

  1. #71 - fixed and added test

    Andrew Goldis committed Mar 13, 2016
    Copy the full SHA
    54c821e View commit details
  2. Merge commit '6daf4cc34ea26ba5829021878ecec74754beaf85'

    * commit '6daf4cc34ea26ba5829021878ecec74754beaf85':
      Fix Cannot read property 'nodeValue' of undefined exception that is thrown when a <key></key> construct appears in plist
    
    # Conflicts:
    #	lib/parse.js
    Andrew Goldis committed Mar 13, 2016
    Copy the full SHA
    3d666f1 View commit details
  3. Copy the full SHA
    97c02b3 View commit details
  4. Merge pull request #69 from agoldis/master

    Fixed empty keys issue #66, added tests
    TooTallNate committed Mar 13, 2016
    Copy the full SHA
    d8d74cb View commit details

Commits on May 12, 2016

  1. Update dependencies

    Mitchell Hentges committed May 12, 2016
    Copy the full SHA
    04c8ee7 View commit details
  2. Merge pull request #73 from mitchhentges/reduce-package-size

    Update dependencies to reduce package size
    TooTallNate committed May 12, 2016
    Copy the full SHA
    0c06929 View commit details

Commits on Jul 8, 2016

  1. Copy the full SHA
    d475cd8 View commit details
  2. Merge pull request #76 from amilajack/patch-1

    Added travis ci support for node 6
    TooTallNate authored Jul 8, 2016
    Copy the full SHA
    7fc9a5b View commit details
  3. Merge pull request #68 from mrzmyr/add-verbose-examples

    add verbose examples
    TooTallNate authored Jul 8, 2016
    Copy the full SHA
    18d3be9 View commit details

Commits on Aug 16, 2016

  1. remove deprecated functions

    Now there's only `build()` and `parse()`!
    
    They've been deprecated for a long time now, and this should
    resolve #77 as well.
    TooTallNate committed Aug 16, 2016
    Copy the full SHA
    90deef5 View commit details
  2. History: normalize

    TooTallNate committed Aug 16, 2016
    Copy the full SHA
    1fe01b3 View commit details
  3. Release 2.0.0

    TooTallNate committed Aug 16, 2016
    Copy the full SHA
    00fb1c4 View commit details
  4. Copy the full SHA
    6bcca80 View commit details
  5. Release 2.0.1

    TooTallNate committed Aug 16, 2016
    Copy the full SHA
    de136c8 View commit details
  6. History: add v2.0.1

    TooTallNate committed Aug 16, 2016
    Copy the full SHA
    c71d9f7 View commit details

Commits on Feb 12, 2017

  1. Harden test-cases and implementation to align with other implementations

    This commit refactors and adds more tests to the `parse()` implementation
    to align with similar libraries's behaviour, e.g.:
    - https://github.com/Microsoft/node-fast-plist
    - https://docs.python.org/3/library/plistlib.html
    
    With the new tests a few of the tests were failing:
    ```
    31 passing (177ms)
    10 failing
    
    1) parse() real should throw an Error when parsing an empty real:
        AssertionError: Missing expected exception..
    
    2) parse() string should parse a self closing string:
        AssertionError: null === ''
    
    3) parse() string should parse an empty string:
        AssertionError: null === ''
    
    4) parse() string should parse a string with comments:
        AssertionError: 'a comment  string' === 'a string'
    
    5) parse() array should parse empty elements inside an array:
        AssertionError: [ false ] deepEqual [ '', false ]
    
    6) parse() dict should throw if key is missing:
        AssertionError: Missing expected exception..
    
    7) parse() dict should throw if two keys follow each other:
        AssertionError: Missing expected exception..
    
    8) parse() dict should throw if value is missing:
        AssertionError: Missing expected exception..
    
    9) parse() dict should parse an empty key:
        AssertionError: {} deepEqual { '': '1' }
    
    10) parse() dict should parse an empty value:
        AssertionError: { a: null } deepEqual { a: '' }
    ```
    
    This commit also refactors the `lib/parse.js` to pass these tests.
    When executing the new implementation of `lib/parse.js` agains the old
    tests the following tests were failing:
    ```
    25 passing (143ms)
    3 failing
    
    1) plist parse() should parse an empty <key/> in a dictionary:
        AssertionError: false == true
    
    2) plist parse() should parse an empty <key></key> in a dictionary:
        AssertionError: false == true
    
    3) plist parse() should parse an empty <key></key> and <string></string> in dictionary with more data:
        AssertionError: { '': '', UIRequiredDeviceCapabilities: [ 'armv7' ] } deepEqual { UIRequiredDeviceCapabilities: [ 'armv7' ] }
    ```
    
    As the output above shows, most of the issue are with the handling of
    empty strings and empty dictionary keys.
    Added with the new implementation are custom Errors for unexpected
    input, better handling of comments inside tags and a more aligned
    handling of empty keys/strings.
    ZauberNerd committed Feb 12, 2017
    Copy the full SHA
    85d11c4 View commit details

Commits on Feb 19, 2017

  1. Copy the full SHA
    7619537 View commit details
  2. Merge pull request #84 from ZauberNerd/harden-parser

    Harden test-cases and align with other implementations
    mreinstein authored Feb 19, 2017
    Copy the full SHA
    4853b74 View commit details

Commits on May 4, 2017

  1. updated changelog

    mreinstein committed May 4, 2017
    Copy the full SHA
    d3b954b View commit details
  2. updated deps

    mreinstein committed May 4, 2017
    Copy the full SHA
    edc6e41 View commit details
  3. Copy the full SHA
    e4f0666 View commit details
  4. updated history.md

    mreinstein committed May 4, 2017
    Copy the full SHA
    314042e View commit details
  5. 2.1.0

    mreinstein committed May 4, 2017
    Copy the full SHA
    b8c7671 View commit details

Commits on Mar 18, 2018

  1. Copy the full SHA
    c962bfe View commit details
  2. Copy the full SHA
    9dfeffe View commit details
  3. added 3.0 to HISTORY

    mreinstein committed Mar 18, 2018
    Copy the full SHA
    6840f12 View commit details
  4. Copy the full SHA
    cb0d8f1 View commit details
  5. 3.0.0 closes #89

    mreinstein committed Mar 18, 2018
    Copy the full SHA
    a85b9d3 View commit details

Commits on Mar 21, 2018

  1. Copy the full SHA
    a7d03aa View commit details
  2. 3.0.1

    mreinstein committed Mar 21, 2018
    Copy the full SHA
    1628c6e View commit details

Commits on Mar 22, 2021

  1. Copy the full SHA
    af45b08 View commit details
  2. Copy the full SHA
    9ec848e View commit details
  3. Copy the full SHA
    3821f55 View commit details
  4. update minor deps

    mreinstein committed Mar 22, 2021
    Copy the full SHA
    eaf1af8 View commit details
  5. Copy the full SHA
    eaf1ca7 View commit details
  6. travis: revert config

    mreinstein committed Mar 22, 2021
    Copy the full SHA
    56c5a74 View commit details

Commits on Mar 26, 2021

  1. Copy the full SHA
    3a8004a View commit details
  2. Copy the full SHA
    eb28b45 View commit details
  3. Copy the full SHA
    e538eb4 View commit details
  4. Copy the full SHA
    ee3c545 View commit details
  5. Copy the full SHA
    6fa1022 View commit details
  6. revert sauce connect

    mreinstein committed Mar 26, 2021
    Copy the full SHA
    1f13bd7 View commit details
  7. Copy the full SHA
    c33edbe View commit details
  8. Copy the full SHA
    e7b0394 View commit details
  9. update deps

    mreinstein committed Mar 26, 2021
    Copy the full SHA
    e828f84 View commit details
Showing with 15,804 additions and 10,117 deletions.
  1. +14 −26 .travis.yml
  2. +65 −13 History.md
  3. +1 −1 LICENSE
  4. +1 −2 Makefile
  5. +62 −27 README.md
  6. +2,057 −3,173 dist/plist-build.js
  7. +2,315 −1,706 dist/plist-parse.js
  8. +4,291 −4,887 dist/plist.js
  9. +13 −0 index.js
  10. +0 −1 lib/build.js
  11. +0 −49 lib/node.js
  12. +96 −81 lib/parse.js
  13. +0 −23 lib/plist.js
  14. +6,704 −0 package-lock.json
  15. +12 −10 package.json
  16. +173 −118 test/parse.js
40 changes: 14 additions & 26 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,34 +1,22 @@
dist: xenial
os: linux
language: node_js
node_js:
- '0.10'
- '0.11'
- '4.0'
- '4.1'
- '6'
- '7'
- '8'
- '9'

env:
global:
- secure: xlLmWO7akYQjmDgrv6/b/ZMGILF8FReD+k6A/u8pYRD2JW29hhwvRwIQGcKp9+zmJdn4i5M4D1/qJkCeI3pdhAYBDHvzHOHSEwLJz1ESB2Crv6fa69CtpIufQkWvIxmZoU49tCaLpMBaIroGihJ4DAXdIVOIz6Ur9vXLDhGsE4c=
- secure: aQ46RdxL10xR5ZJJTMUKdH5k4tdrzgZ87nlwHC+pTr6bfRw3UKYC+6Rm7yQpg9wq0Io9O9dYCP007gQGSWstbjr1+jXNu/ubtNG+q5cpWBQZZZ013VHh9QJTf1MnetsZxbv8Yhrjg590s6vruT0oqesOnB2CizO/BsKxnY37Nos=
matrix:
- secure: R4tCAipsC0KdBPin8+rWedqptn0RXksLM20yZ0w8En0hhaglWCiIxA5uKt/6njXp9Q8FEKkVOyWF+yjq74jB6+KUu0dSK30pbmaAHhlXsL5kTWmY9vd7rxwcn1Hdf1sW15NqRX4hvWuIC32cA7vDr+58VPyum+A+yvPJICvgIlw=
- secure: sfEwCcmUrfFPIRPV8UwdJymRZ8YY20fuJiAlWfOUQSOccNGWB4RbUsD+iyc9XW5qB1kdOqxVkvZ0sKrYo3Uc4k8mhar7+yhP04hfNj4CWAigG3rtTugbar9kSQjwi/yEaTrb4kdP8HRYs5yjrEX/CGwjm3iHGOSyUw5du0PQfbk=

jobs:
include:
- node_js: '0.10'
- node_js: '8'
env: BROWSER_NAME=chrome BROWSER_VERSION=latest
- node_js: '0.10'
env: BROWSER_NAME=chrome BROWSER_VERSION=29
- node_js: '0.10'
- node_js: '8'
env: BROWSER_NAME=firefox BROWSER_VERSION=latest
- node_js: '0.10'
env: BROWSER_NAME=opera BROWSER_VERSION=latest
- node_js: '0.10'
env: BROWSER_NAME=safari BROWSER_VERSION=latest
- node_js: '0.10'
env: BROWSER_NAME=safari BROWSER_VERSION=7
- node_js: '0.10'
env: BROWSER_NAME=safari BROWSER_VERSION=6
- node_js: '0.10'
env: BROWSER_NAME=safari BROWSER_VERSION=5
- node_js: '0.10'
- node_js: '8'
env: BROWSER_NAME=ie BROWSER_VERSION=11
- node_js: '0.10'
env: BROWSER_NAME=ie BROWSER_VERSION=10
- node_js: '0.10'
env: BROWSER_NAME=ie BROWSER_VERSION=9
78 changes: 65 additions & 13 deletions History.md
Original file line number Diff line number Diff line change
@@ -1,22 +1,73 @@
3.0.2 / 2021-03-25
==================
* update xmldom to 0.5.0 to patch critical vulnerability (Mike Reinstein)
* update saucelab credentials to point at mreinstein's saucelabs account (Mike Reinstein)
* remove a bunch of test versions from the matrix because they weren't working in zuul + sauce (Mike Reinstein)


3.0.1 / 2018-03-21
==================
* avoid using Buffer constructor nodejs/node#19079


3.0.0 / 2018-03-18
==================
* [[`cb0d8f1bc6`]](https://github.com/TooTallNate/plist.js/commit/cb0d8f1bc60dee423f8fc2cfcac427452dfaddb0) update Makefile, rebuild dist/ (Mike Reinstein)
* [[`9dfeffe73f`]](https://github.com/TooTallNate/plist.js/commit/9dfeffe73fdb447ac5a87ee364a1472975f12adf) remove unsupported browser versions from travis (Mike Reinstein)
* [[`c962bfe1ea`]](https://github.com/TooTallNate/plist.js/commit/c962bfe1ea04dd87966250253d33738bceecab61) update module deps, remove support for node < 6 (Mike Reinstein)


2.1.0 / 2017-05-04
==================

* [[`e4f06669bb`]](https://github.com/TooTallNate/plist.js/commit/e4f06669bb51d2e65654df7c39aab52bc3bf4e8a) - update license (extend copyright term) (Mike Reinstein)
* [[`edc6e41035`]](https://github.com/TooTallNate/plist.js/commit/edc6e4103546b1d7518a577e7c202c305a8abec0) - update module deps (Mike Reinstein)
* [[`85d11c48ef`](https://github.com/TooTallNate/plist.js/commit/85d11c48eff02312cbdd67f46fd8e74b0d372ca1)] - Harden test-cases and implementation to align with other implementations (Björn Brauer)
* [[`7619537eaa`]](https://github.com/TooTallNate/plist.js/commit/7619537eaa9e3e5a80829e759c004d2e017a07d2) review feedback: early returns and constants for nodeTypes (Björn Brauer)


2.0.1 / 2016-08-16
==================

* [[`de136c8388`](https://github.com/TooTallNate/plist/commit/de136c8388)] - bad npm release… (Nathan Rajlich)


2.0.0 / 2016-08-16
==================

* [[`90deef5d43`](https://github.com/TooTallNate/plist/commit/90deef5d43)] - remove deprecated functions (Nathan Rajlich)
* [[`d475cd8ce9`](https://github.com/TooTallNate/plist/commit/d475cd8ce9)] - Added travis ci support for node 6 (Amila Welihinda)
* [[`04c8ee7646`](https://github.com/TooTallNate/plist/commit/04c8ee7646)] - update dependencies (Mitchell Hentges)
* [[`97c02b3f05`](https://github.com/TooTallNate/plist/commit/97c02b3f05)] - **travis**: add `sudo: false` and test more node versions (Nathan Rajlich)
* [[`54c821ec29`](https://github.com/TooTallNate/plist/commit/54c821ec29)] - #71 - fixed and added test (Andrew Goldis)
* [[`4afb7c5079`](https://github.com/TooTallNate/plist/commit/4afb7c5079)] - fix `Cannot read property 'nodeValue' of undefined exception` that is thrown when a `<key></key>` construct appears in plist (Chris Kinsman)
* [[`f360d7d685`](https://github.com/TooTallNate/plist/commit/f360d7d685)] - #66 - fixed empty keys and added tests (Andrew Goldis)
* [[`421c7f26e9`](https://github.com/TooTallNate/plist/commit/421c7f26e9)] - #66 - fixed empty key (Andrew Goldis)
* [[`a88aa4dca7`](https://github.com/TooTallNate/plist/commit/a88aa4dca7)] - add verbose examples (mrzmyr)


1.2.0 / 2015-11-10
==================

* package: update "browserify" to v12.0.1
* package: update "zuul" to v3.7.2
* package: update "xmlbuilder" to v4.0.0
* package: update "util-deprecate" to v1.0.2
* package: update "mocha" to v2.3.3
* package: update "base64-js" to v0.0.8
* build: omit undefined values
* travis: add node 4.0 and 4.1 to test matrix

* package: update "browserify" to v12.0.1
* package: update "zuul" to v3.7.2
* package: update "xmlbuilder" to v4.0.0
* package: update "util-deprecate" to v1.0.2
* package: update "mocha" to v2.3.3
* package: update "base64-js" to v0.0.8
* build: omit undefined values
* travis: add node 4.0 and 4.1 to test matrix

1.1.0 / 2014-08-27
==================

* package: update "browserify" to v5.10.1
* package: update "zuul" to v1.10.2
* README: add "Sauce Test Status" build badge
* travis: use new "plistjs" sauce credentials
* travis: set up zuul saucelabs automated testing
* package: update "browserify" to v5.10.1
* package: update "zuul" to v1.10.2
* README: add "Sauce Test Status" build badge
* travis: use new "plistjs" sauce credentials
* travis: set up zuul saucelabs automated testing


1.0.1 / 2014-06-25
==================
@@ -28,6 +79,7 @@
* README: update examples to use preferred API
* package: add "browser" keyword


1.0.0 / 2014-05-20
==================

2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
(The MIT License)

Copyright (c) 2010-2014 Nathan Rajlich <nathan@tootallnate.net>
Copyright (c) 2010-2017 Nathan Rajlich <nathan@tootallnate.net>

Permission is hereby granted, free of charge, to any person
obtaining a copy of this software and associated documentation
3 changes: 1 addition & 2 deletions Makefile
Original file line number Diff line number Diff line change
@@ -38,8 +38,7 @@ dist/plist-parse.js: node_modules lib/parse.js dist
dist/plist.js: node_modules lib/*.js dist
@$(BROWSERIFY) \
--standalone plist \
--ignore lib/node.js \
lib/plist.js > $@
index.js > $@

node_modules: package.json
@NODE_ENV= $(NPM) install
89 changes: 62 additions & 27 deletions README.md
Original file line number Diff line number Diff line change
@@ -69,8 +69,34 @@ Parsing a plist from string payload:
``` javascript
var plist = require('plist');

var obj = plist.parse('<plist><string>Hello World!</string></plist>');
console.log(obj); // Hello World!
var xml =
'<?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">' +
'<key>metadata</key>' +
'<dict>' +
'<key>bundle-identifier</key>' +
'<string>com.company.app</string>' +
'<key>bundle-version</key>' +
'<string>0.1.1</string>' +
'<key>kind</key>' +
'<string>software</string>' +
'<key>title</key>' +
'<string>AppName</string>' +
'</dict>' +
'</plist>';

console.log(plist.parse(xml));

// [
// "metadata",
// {
// "bundle-identifier": "com.company.app",
// "bundle-version": "0.1.1",
// "kind": "software",
// "title": "AppName"
// }
// ]
```

### Building
@@ -81,33 +107,42 @@ that complies with the plist DTD:
``` javascript
var plist = require('plist');

console.log(plist.build({ foo: 'bar' }));
var json = [
"metadata",
{
"bundle-identifier": "com.company.app",
"bundle-version": "0.1.1",
"kind": "software",
"title": "AppName"
}
];

console.log(plist.build(json));

// <?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">
// <key>metadata</key>
// <dict>
// <key>bundle-identifier</key>
// <string>com.company.app</string>
// <key>bundle-version</key>
// <string>0.1.1</string>
// <key>kind</key>
// <string>software</string>
// <key>title</key>
// <string>AppName</string>
// </dict>
// </plist>
```

## Cross Platform Testing Credits

Much thanks to Sauce Labs for providing free resources that enable cross-browser testing on this project!

[![Testing Powered By SauceLabs](https://opensource.saucelabs.com/images/opensauce/powered-by-saucelabs-badge-red.png?sanitize=true "Testing Powered By SauceLabs")](https://saucelabs.com)


## License

(The MIT License)

Copyright (c) 2010-2014 Nathan Rajlich <nathan@tootallnate.net>

Permission is hereby granted, free of charge, to any person
obtaining a copy of this software and associated documentation
files (the "Software"), to deal in the Software without
restriction, including without limitation the rights to use,
copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the
Software is furnished to do so, subject to the following
conditions:

The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
OTHER DEALINGS IN THE SOFTWARE.
[(The MIT License)](LICENSE)
Loading