Skip to content

Commit

Permalink
bump version, add setSubject method to VCs
Browse files Browse the repository at this point in the history
  • Loading branch information
cykoder committed Oct 5, 2021
1 parent 7138a50 commit 87ea4f1
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@docknetwork/sdk",
"version": "0.5.7",
"version": "0.5.8",
"main": "index.js",
"license": "MIT",
"repository": {
Expand Down
13 changes: 13 additions & 0 deletions src/verifiable-credential.js
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,19 @@ class VerifiableCredential {
return this;
}

/**
* Set the subject for this Credential
* @param {object|array} subject - Subject of the credential as object or array
* @returns {VerifiableCredential}
*/
setSubject(subject) {
if (!isObject(subject) && !Array.isArray(subject)) {
throw new Error('credentialSubject must be either an object or array');
}
this.credentialSubject = subject;
return this;
}

/**
* Set a status for this Credential
* @param {object} status - Status of the credential
Expand Down

0 comments on commit 87ea4f1

Please sign in to comment.