shc-covid19-decoder
shc-covid19-decoder copied to clipboard
Arrays and Objects aren't properly displayed in JSON from terminal
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]
}
}
]
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");
}
);