Commit f01e7089 authored by Melroy van den Berg's avatar Melroy van den Berg

fix lint

parent 1bf066b1
Pipeline #1302 passed with stage
in 1 minute and 2 seconds
......@@ -35,7 +35,7 @@ const lbry = new LBRY(LBRYNET_HOST, LBRYNET_PORT,
const exchange = new Exchange(COINMARKETCAP_API_TOKEN)
// TODO: Only create a TelegramBot object, when bot server is enabled for serving Telegram requests
// Currently only Telegram is supported until futher notice.
const telegramBot = new TelegramBot(TELEGRAM_TOKEN)
// This informs the Telegram servers of the new webhook.
telegramBot.setWebHook(`${botUrl}/telegram/bot${TelegramSecretHash}`)
......
class Misc {
/**
* Convert Date object to string
* @param {Date} - date
* @param {Date} - date
* @return {string} formatted date string
*/
static printDate(date) {
static printDate (date) {
const options = { year: 'numeric', month: 'long', day: 'numeric' }
return date.toLocaleDateString('en-US', options) + ' ' + date.toLocaleTimeString('en-US')
}
......@@ -14,16 +14,16 @@ class Misc {
* @param {string} - hash string
* @return {Boolean} True if SHA256 otherwise false
*/
static isSha256(hash) {
static isSha256 (hash) {
return hash.match(/^([a-f0-9]{64})$/) != null
}
/**
* Convert timestamp to date (approximately)
* @param {Date} timestamp
* @param {Date} timestamp
* @turn {Dict} structure of year, month, day, hour, minute, second
*/
static timestampToDate(timestamp) {
static timestampToDate (timestamp) {
let seconds = Math.floor(timestamp / 1000)
let minutes = Math.floor(seconds / 60)
seconds = seconds % 60
......@@ -35,8 +35,8 @@ class Misc {
days = days % 30
const years = Math.floor(months / 12)
months = months % 12
return {year: years, month: months, day: days, hour: hours, minute: minutes, second: seconds}
return { year: years, month: months, day: days, hour: hours, minute: minutes, second: seconds }
}
}
module.exports = Misc
\ No newline at end of file
module.exports = Misc
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment