refactor: improve code format

PS: Just know my baby had it's first kick :D
pull/144/head
Amio 2018-09-05 20:25:51 +08:00
rodzic c71f22ff41
commit 9f3ed7402f
1 zmienionych plików z 6 dodań i 3 usunięć

Wyświetl plik

@ -1,6 +1,8 @@
const got = require('../got.js')
const convertFingerprintTo64bit = fingerprint => fingerprint.slice(-16).toUpperCase().match(/.{1,4}/g).join(' ')
const convertFingerprintTo64bit = fingerprint => {
return fingerprint.slice(-16).toUpperCase().match(/.{4}/g).join(' ')
}
module.exports = async (topic, username) => {
const endpoint = `https://keybase.io/_/api/1.0/user/lookup.json`
@ -10,13 +12,14 @@ module.exports = async (topic, username) => {
fields: 'public_keys'
}
})
const user = body.them[0]
const fingerprint = body.them[0].public_keys.primary.key_fingerprint
switch (topic) {
case 'pgp':
return {
subject: 'PGP',
status: convertFingerprintTo64bit(user.public_keys.primary.key_fingerprint),
status: convertFingerprintTo64bit(fingerprint),
color: 'blue'
}
default: