kopia lustrzana https://github.com/badgen/badgen.net
refactor: improve code format
PS: Just know my baby had it's first kick :Dpull/144/head
rodzic
c71f22ff41
commit
9f3ed7402f
|
|
@ -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:
|
||||
|
|
|
|||
Ładowanie…
Reference in New Issue