wadl-client
Advanced tools
Comparing version 1.0.3 to 2.0.0
{ | ||
"name": "wadl-client", | ||
"version": "1.0.3", | ||
"version": "2.0.0", | ||
"description": "Generate a Javascript client for a web API providing a WADL description", | ||
@@ -15,4 +15,3 @@ "main": "wadl-client.js", | ||
"baconjs": "^0.7.70", | ||
"request": "^2.60.0", | ||
"xml2json": "^0.7.1" | ||
"request": "^2.60.0" | ||
}, | ||
@@ -19,0 +18,0 @@ "devDependencies": { |
@@ -5,4 +5,11 @@ var WadlClient = (function() { | ||
var request = typeof XMLHttpRequest != "undefined" ? null : require("request"); | ||
var parser = typeof XMLHttpRequest != "undefined" ? null : require("xml2json"); | ||
// If you want xml2json support, add it as a dependency of your project | ||
var parser; | ||
try{ | ||
parser = typeof XMLHttpRequest != "undefined" ? null : require("xml2json"); | ||
} catch(err){ | ||
parser = null; | ||
} | ||
/* Utils */ | ||
@@ -36,2 +43,6 @@ var Utils = {}; | ||
else if(Utils.elem(contentType || "", ["text/xml", "application/rss+xml", "application/rdf+xml", "application/atom+xml"])) { | ||
if(!response.responseXML && !parser){ | ||
throw new Error("Parser is undefined. Please add xml2json as a dependency in your project"); | ||
} | ||
return response.responseXML ? response.responseXML : parser.toJson(body, { | ||
@@ -38,0 +49,0 @@ object: true, |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
29936
2
934
3
- Removedxml2json@^0.7.1
- Removedbindings@1.5.0(transitive)
- Removedfile-uri-to-path@1.0.0(transitive)
- Removednan@2.22.0(transitive)
- Removednode-expat@2.4.1(transitive)
- Removedxml2json@0.7.1(transitive)