Skip to content

Commit

Permalink
fix lint errors
Browse files Browse the repository at this point in the history
  • Loading branch information
jchartrand committed Jan 16, 2025
1 parent 8884891 commit 5c502e7
Showing 1 changed file with 11 additions and 12 deletions.
23 changes: 11 additions & 12 deletions lib/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -355,21 +355,20 @@ async function _verifyCredential(options = {}) {
log.push({id: 'valid_signature', valid: true});
log.push({id: 'issuer_did_resolves', valid: true});

// if credential status is provided, a `checkStatus` function must be given
if(credential.credentialStatus && typeof checkStatus !== 'function') {
throw new TypeError(
'A "checkStatus" function must be given to verify credentials with ' +
'"credentialStatus".');
}
if(credential.credentialStatus) {
await addStatusInfoToLog({options, result, log});
}
// if credential status is provided, a `checkStatus` function must be given
if(credential.credentialStatus && typeof checkStatus !== 'function') {
throw new TypeError(
'A "checkStatus" function must be given to verify credentials with ' +
'"credentialStatus".');
}

if(credential.credentialStatus) {
await addStatusInfoToLog({options, result, log});
}

// run common credential checks (add check results to log)
_checkCredential({credential, log, now});


result.log = log;
if(result.results) {
result.results[0].log = log;
Expand Down

0 comments on commit 5c502e7

Please sign in to comment.