Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

wadl-client

Package Overview
Dependencies
Maintainers
3
Versions
28
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

wadl-client - npm Package Compare versions

Comparing version 1.0.3 to 2.0.0

5

package.json
{
"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": {

13

wadl-client.js

@@ -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,

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc