shc-covid19-decoder icon indicating copy to clipboard operation
shc-covid19-decoder copied to clipboard

Arrays and Objects aren't properly displayed in JSON from terminal

Open tremblaysimon opened this issue 3 years ago • 1 comments

The output currently looks like that when we decode from the command line:

[
  {
    resource: {
      resourceType: 'Patient',
      name: [Array],
      birthDate: '1942-01-01',
      gender: 'Male'
    }
  },
  {
    resource: {
      resourceType: 'Immunization',
      vaccineCode: [Object],
      patient: [Object],
      lotNumber: 'EW0193',
      status: 'Completed',
      occurrenceDateTime: '2021-01-01T04:00:00+00:00',
      location: [Object],
      protocolApplied: [Object],
      note: [Array]
    }
  }
]

tremblaysimon avatar May 24 '21 03:05 tremblaysimon

Just add a JSON.stringify to line 36, like that:

verifyJWS(scannedJWS).then(
  function (result) {
    return decodeJWS(scannedJWS).then((decoded) => console.log(JSON.stringify(decoded, null, 2)));
  },
  function (e) {
    console.log("Ooooh crap - this looks like a fake vacinnation proof");
  }
);

jitbasemartin avatar Jul 13 '21 19:07 jitbasemartin