forked from Mirrors/doipjs
Run prettier
This commit is contained in:
parent
0bb3a59964
commit
95ac04b838
4 changed files with 47 additions and 39 deletions
|
@ -22,16 +22,22 @@ const keys = require('./keys')
|
||||||
const utils = require('./utils')
|
const utils = require('./utils')
|
||||||
|
|
||||||
// Promise.allSettled polyfill
|
// Promise.allSettled polyfill
|
||||||
Promise.allSettled = Promise.allSettled || ((promises) => Promise.all(promises.map(p => p
|
Promise.allSettled =
|
||||||
.then(v => ({
|
Promise.allSettled ||
|
||||||
|
((promises) =>
|
||||||
|
Promise.all(
|
||||||
|
promises.map((p) =>
|
||||||
|
p
|
||||||
|
.then((v) => ({
|
||||||
status: 'fulfilled',
|
status: 'fulfilled',
|
||||||
value: v,
|
value: v,
|
||||||
}))
|
}))
|
||||||
.catch(e => ({
|
.catch((e) => ({
|
||||||
status: 'rejected',
|
status: 'rejected',
|
||||||
reason: e,
|
reason: e,
|
||||||
}))
|
}))
|
||||||
)));
|
)
|
||||||
|
))
|
||||||
|
|
||||||
const runVerificationJson = (
|
const runVerificationJson = (
|
||||||
res,
|
res,
|
||||||
|
|
12
src/keys.js
12
src/keys.js
|
@ -31,12 +31,12 @@ const fetchHKP = (identifier, keyserverBaseUrl) => {
|
||||||
query: identifier,
|
query: identifier,
|
||||||
}
|
}
|
||||||
|
|
||||||
let publicKey = await hkp.lookup(lookupOpts)
|
let publicKey = await hkp.lookup(lookupOpts).catch((error) => {
|
||||||
.catch((error) => {
|
|
||||||
reject('Key does not exist or could not be fetched')
|
reject('Key does not exist or could not be fetched')
|
||||||
})
|
})
|
||||||
|
|
||||||
publicKey = await openpgp.key.readArmored(publicKey)
|
publicKey = await openpgp.key
|
||||||
|
.readArmored(publicKey)
|
||||||
.then((result) => {
|
.then((result) => {
|
||||||
return result.keys[0]
|
return result.keys[0]
|
||||||
})
|
})
|
||||||
|
@ -59,7 +59,8 @@ const fetchWKD = (identifier) => {
|
||||||
email: identifier,
|
email: identifier,
|
||||||
}
|
}
|
||||||
|
|
||||||
const publicKey = await wkd.lookup(lookupOpts)
|
const publicKey = await wkd
|
||||||
|
.lookup(lookupOpts)
|
||||||
.then((result) => {
|
.then((result) => {
|
||||||
return result.keys[0]
|
return result.keys[0]
|
||||||
})
|
})
|
||||||
|
@ -90,7 +91,8 @@ const fetchKeybase = (username, fingerprint) => {
|
||||||
reject(`Error fetching Keybase key: ${e.message}`)
|
reject(`Error fetching Keybase key: ${e.message}`)
|
||||||
}
|
}
|
||||||
|
|
||||||
const publicKey = await openpgp.key.readArmored(rawKeyContent)
|
const publicKey = await openpgp.key
|
||||||
|
.readArmored(rawKeyContent)
|
||||||
.then((result) => {
|
.then((result) => {
|
||||||
return result.keys[0]
|
return result.keys[0]
|
||||||
})
|
})
|
||||||
|
|
Loading…
Reference in a new issue