From 6e20d13b030df3b59d4eab398cb00e7901b9107d Mon Sep 17 00:00:00 2001 From: F-Node-Karlsruhe Date: Thu, 31 Aug 2023 15:40:38 +0200 Subject: [PATCH] allow credentialStatus arrays in check Signed-off-by: F-Node-Karlsruhe --- lib/index.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/index.js b/lib/index.js index 61943245..f125adf3 100644 --- a/lib/index.js +++ b/lib/index.js @@ -654,10 +654,10 @@ export function _checkCredential({ } if('credentialStatus' in credential) { - if(!credential.credentialStatus.id) { + if(Array.isArray(credential.credentialStatus) ? credential.credentialStatus.some(cs => !cs.id) : !credential.credentialStatus.id) { throw new Error('"credentialStatus" must include an id.'); } - if(!credential.credentialStatus.type) { + if(Array.isArray(credential.credentialStatus) ? credential.credentialStatus.some(cs => !cs.type) : !credential.credentialStatus.type) { throw new Error('"credentialStatus" must include a type.'); } }