public/verifier/qr.js
//   Note: Single part QR codes will have an 'undefined' 'parts' property.
Single part QR codes will have an 'undefined' 'parts' property.
Single part QR codes will have an ' undefined ' ' parts ' property .
function parseShc(schString) {
        schString = schString.trim();
        let regex = /^shc:\/(\d+)$/;
        let result = regex.exec(schString);
        if (result) return { part: 1, parts: undefined, data: result[1], full: schString };
        regex = /^shc:\/(\d+)\/(\d+)\/(\d+)$/;
        result = regex.exec(schString);
        if (result) return { part: parseInt(result[1]), parts: parseInt(result[2]), data: result[3], full: schString };
        return undefined;
    }
function parseShc ( schString ) { schString = schString . trim ( ) ; let regex = / ^shc:\/(\d+)$ / ; let result = regex . exec ( schString ) ; if ( result ) return { part : 1 , parts : undefined , data : result [ 1 ] , full : schString } ; regex = / ^shc:\/(\d+)\/(\d+)\/(\d+)$ / ; result = regex . exec ( schString ) ; if ( result ) return { part : parseInt ( result [ 1 ] ) , parts : parseInt ( result [ 2 ] ) , data : result [ 3 ] , full : schString } ; return undefined ; }
Note: Single part QR codes will have an 'undefined' 'parts' property.
Note : Single part QR codes will have an ' undefined ' ' parts ' property .