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:
+17
-15
@@ -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);
|
||||
});
|
||||
}
|
||||
};
|
||||
Reference in New Issue
Block a user