fix: Apply rome linter fixes

This commit is contained in:
Yarmo Mackenbach 2023-03-06 21:59:00 +01:00
parent e2a344848c
commit e98995ec0d
5 changed files with 5 additions and 6 deletions

View file

@ -251,7 +251,7 @@ class Claim {
// Post process the data
const def = claimDefinitions.data[claimData.serviceprovider.name]
if (def.functions && def.functions.postprocess) {
if (def.functions?.postprocess) {
try {
({ claimData, proofData } = def.functions.postprocess(claimData, proofData))
} catch (_) {}

View file

@ -54,7 +54,7 @@ module.exports.fn = async (data, opts) => {
throw new Error(`Telegram fetcher was not set up properly (${err.message})`)
}
if (!data.chat || !data.user) {
if (!(data.chat && data.user)) {
reject(new Error('Both chat name and user name must be provided'))
return
}

View file

@ -260,7 +260,7 @@ const fetch = async (identifier) => {
* });
*/
const process = async (publicKey) => {
if (!publicKey || !(publicKey instanceof openpgp.PublicKey)) {
if (!(publicKey && (publicKey instanceof openpgp.PublicKey))) {
throw new Error('Invalid public key')
}

View file

@ -93,7 +93,6 @@ const containsProof = async (data, fingerprint, claimFormat) => {
break
default:
continue
}
}
}

View file

@ -21,8 +21,8 @@ const path = require('path')
const openpgp = require('openpgp')
const doipjs = require('../src')
const pubKeyFingerprint = `3637202523e7c1309ab79e99ef2dc5827b445f4b`
const pubKeyEmail = `test@doip.rocks`
const pubKeyFingerprint = "3637202523e7c1309ab79e99ef2dc5827b445f4b"
const pubKeyEmail = "test@doip.rocks"
const pubKeyPlaintext = `-----BEGIN PGP PUBLIC KEY BLOCK-----