Code cleanup

-Replace tabs with double-spaces
-Betting spacing and lining up of code functions
-Add missing semi-colons
-Remove extra characters and spaces where applicable
-Remove commented-out code fragments
-Add missing 2021 date to LICENSE
-Small touchups and other misc nitpickings
This commit is contained in:
joeuhren
2021-03-17 17:54:09 -06:00
parent 8304eb211d
commit 20c0a382a3
42 changed files with 1001 additions and 860 deletions
+17 -15
View File
@@ -1,21 +1,23 @@
var request = require('postman-request');
function get_usd_value(cb) {
request({ uri: 'https://api.coindesk.com/v1/bpi/currentprice/USD.json', json: true, headers: {'User-Agent': 'eiquidus'} }, function (error, response, body) {
if (error) {
return cb(error, 0);
} else {
return cb(null, body.bpi.USD['rate_float'].toFixed(4));
}
});
request({ uri: 'https://api.coindesk.com/v1/bpi/currentprice/USD.json', json: true, headers: {'User-Agent': 'eiquidus'} }, function (error, response, body) {
if (error)
return cb(error, 0);
else
return cb(null, body.bpi.USD['rate_float'].toFixed(4));
});
}
module.exports = {
get_data: function (cb) {
var error = null;
get_usd_value(function (err, last_usd) {
if (err) { error = err; }
return cb(error, last_usd);
});
}
get_data: function (cb) {
var error = null;
get_usd_value(function (err, last_usd) {
if (err)
error = err;
return cb(error, last_usd);
});
}
};