Skip to content

Commit

Permalink
Change xml2json to xml2js
Browse files Browse the repository at this point in the history
  • Loading branch information
OverloadUT committed Jul 6, 2015
1 parent 1048f94 commit 1141dbb
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions lib/api.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ var uuid = require('uuid');
var url = require('url');
var request = require('request');
var Q = require('q');
var xml2json = require('xml2json');
var xml2js = require('xml2js');

var uri = require('./uri');
var auth = require('./auth');
Expand Down Expand Up @@ -122,7 +122,7 @@ PlexAPI.prototype._request = function _request(relativeUrl, method, parseRespons
return deferred.resolve(JSON.parse(body.toString('utf8')));
}
if (response.headers['content-type'].indexOf('xml') > -1) {
return deferred.resolve(xml2json.toJson(body.toString('utf8'), {
return deferred.resolve(xml2js.parseString(body.toString('utf8'), {
object: true
}));
}
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"q": "^1.0.1",
"request": "^2.36.0",
"uuid": "^2.0.1",
"xml2json": "^0.6.2"
"xml2js": "^0.4.9"
},
"devDependencies": {
"expect.js": "*",
Expand Down

2 comments on commit 1141dbb

@OverloadUT
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was not supposed to commit directly to this repository - either I hit the wrong button or the pull request feature in SourceTree doesn't work the way I thought. I am going to reverse it and do it as a pull request to open discussion on it!

Edit: yep, it was SourceTree. Trying to submit a pull request from source tree changed my feature branch to become tracked to the upstream master branch which makes no sense! I won't be using that feature in the future...

@phillipj
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Haha, no worries! Good you learnt something from it 😃

Please sign in to comment.