Comparing version 0.0.2 to 0.0.3
@@ -43,8 +43,18 @@ (function() { | ||
return request(options, function(err, response, body) { | ||
var data, error; | ||
if (!cb) { | ||
return; | ||
} | ||
if (err) { | ||
cb(err); | ||
} | ||
if (typeof body === 'string') { | ||
body = JSON.parse(body); | ||
try { | ||
data = JSON.parse(body); | ||
} catch (_error) { | ||
error = _error; | ||
err = body; | ||
} | ||
} | ||
if (cb) { | ||
return cb(err, body); | ||
} | ||
return cb(err, data); | ||
}); | ||
@@ -51,0 +61,0 @@ }; |
{ | ||
"name": "teamcity", | ||
"version": "0.0.2", | ||
"version": "0.0.3", | ||
"description": "TeamCity API", | ||
@@ -5,0 +5,0 @@ "author": "Jeff Knaggs", |
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
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
8004
179