@bedrock/vc-verifier 22.1.0 → 22.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/lib/vcb.js +6 -0
  2. package/package.json +1 -1
package/lib/vcb.js CHANGED
@@ -27,6 +27,8 @@ const SUPPORTED_BARCODE_FORMATS = new Set([
27
27
  'pdf417'
28
28
  ]);
29
29
 
30
+ const TEXT_DECODER = new TextDecoder();
31
+
30
32
  export async function verifyEnvelopedCredential({
31
33
  config, contents, format, checks
32
34
  } = {}) {
@@ -76,6 +78,10 @@ export async function verifyEnvelopedCredential({
76
78
  async function _parseQrCodeEnvelope({
77
79
  contents, documentLoader, typeTableLoader
78
80
  }) {
81
+ // `fromQrCode` requires text, so convert to text as needed
82
+ if(contents instanceof Uint8Array) {
83
+ contents = TEXT_DECODER.decode(contents);
84
+ }
79
85
  const {jsonldDocument: credential} = await util.fromQrCode({
80
86
  text: contents,
81
87
  documentLoader,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bedrock/vc-verifier",
3
- "version": "22.1.0",
3
+ "version": "22.1.1",
4
4
  "type": "module",
5
5
  "description": "Bedrock VC Verifier",
6
6
  "main": "./lib/index.js",