Skip to content

Commit

Permalink
Fix linting error.
Browse files Browse the repository at this point in the history
  • Loading branch information
dlongley committed Nov 15, 2023
1 parent b49acd6 commit ebc17f2
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions lib/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -654,10 +654,13 @@ export function _checkCredential({
}

if('credentialStatus' in credential) {
if(Array.isArray(credential.credentialStatus) ? credential.credentialStatus.some(cs => !cs.id) : !credential.credentialStatus.id) {
const {credentialStatus} = credential;
if(Array.isArray(credentialStatus) ?
credentialStatus.some(cs => !cs.id) : !credentialStatus.id) {
throw new Error('"credentialStatus" must include an id.');
}
if(Array.isArray(credential.credentialStatus) ? credential.credentialStatus.some(cs => !cs.type) : !credential.credentialStatus.type) {
if(Array.isArray(credentialStatus) ?
credentialStatus.some(cs => !cs.type) : !credentialStatus.type) {
throw new Error('"credentialStatus" must include a type.');
}
}
Expand Down

0 comments on commit ebc17f2

Please sign in to comment.