Comparing version 0.0.2 to 0.0.3
32
index.js
@@ -33,6 +33,10 @@ var request = require('request'); | ||
}, function (err, res, body) { | ||
if (res.statusCode === 200) { | ||
cb(null, toJSON(body)); | ||
if (!err) { | ||
if (res.statusCode === 200) { | ||
cb(null, toJSON(body)); | ||
} else { | ||
cb(JSON.parse(toJSON(body))); | ||
} | ||
} else { | ||
cb(JSON.parse(toJSON(body))); | ||
throw new Error(err); | ||
} | ||
@@ -56,7 +60,11 @@ }); | ||
}, function (err, res, body) { | ||
if (res.statusCode === 200) { | ||
cb(null, toJSON(body)); | ||
if (!err) { | ||
if (res.statusCode === 200) { | ||
cb(null, toJSON(body)); | ||
} else { | ||
cb(toJSON(body)); | ||
} | ||
} else { | ||
cb(toJSON(body)); | ||
} | ||
throw new Error(err); | ||
} | ||
}); | ||
@@ -79,6 +87,10 @@ }; | ||
}, function (err, res, body) { | ||
if (res.statusCode === 200) { | ||
cb(null, toJSON(body)); | ||
if (!err) { | ||
if (res.statusCode === 200) { | ||
cb(null, toJSON(body)); | ||
} else { | ||
cb(toJSON(body)); | ||
} | ||
} else { | ||
cb(toJSON(body)); | ||
throw new Error(err); | ||
} | ||
@@ -85,0 +97,0 @@ }); |
{ | ||
"name": "authy", | ||
"version": "0.0.2", | ||
"version": "0.0.3", | ||
"description": "Authy.com API lib for node.js", | ||
@@ -10,3 +10,3 @@ "main": "index.js", | ||
"scripts": { | ||
"test": "echo \"Error: no test specified\" && exit 1" | ||
"test": "nodeunit tests/tests.js" | ||
}, | ||
@@ -13,0 +13,0 @@ "repository": { |
node-authy | ||
========== | ||
Authy API Client for node.js | ||
[Authy](https://authy.com/) API Client for node.js | ||
@@ -6,0 +6,0 @@ Usage |
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
No tests
QualityPackage does not have any tests. This is a strong signal of a poorly maintained or low quality package.
Found 1 instance in 1 package
7012
155
2