lib/qr-base.js
function getTemplate(message, ec_level) {
    var i = 1;
    var len;

    if (message.data1) {
        len = Math.ceil(message.data1.length / 8);
    } else {
        i = 10;
    }
    for (/* i */; i < 10; i++) {
        var version = versions[i][ec_level];
        if (version.data_len >= len) {
            return _deepCopy(version);
        }
    }

    if (message.data10) {
        len = Math.ceil(message.data10.length / 8);
    } else {
        i = 27;
    }
    for (/* i */; i < 27; i++) {
        var version = versions[i][ec_level];
        if (version.data_len >= len) {
            return _deepCopy(version);
        }
    }

    len = Math.ceil(message.data27.length / 8);
    for (/* i */; i < 41; i++) {
        var version = versions[i][ec_level];
        if (version.data_len >= len) {
            return _deepCopy(version);
        }
    }
    throw new Error("Too much data");
}
function getTemplate(message, ec_level) {
    var i = 1;
    var len;

    if (message.data1) {
        len = Math.ceil(message.data1.length / 8);
    } else {
        i = 10;
    }
    for (/* i */; i < 10; i++) {
        var version = versions[i][ec_level];
        if (version.data_len >= len) {
            return _deepCopy(version);
        }
    }

    if (message.data10) {
        len = Math.ceil(message.data10.length / 8);
    } else {
        i = 27;
    }
    for (/* i */; i < 27; i++) {
        var version = versions[i][ec_level];
        if (version.data_len >= len) {
            return _deepCopy(version);
        }
    }

    len = Math.ceil(message.data27.length / 8);
    for (/* i */; i < 41; i++) {
        var version = versions[i][ec_level];
        if (version.data_len >= len) {
            return _deepCopy(version);
        }
    }
    throw new Error("Too much data");
}
function getTemplate ( message , ec_level ) { var i = 1 ; var len ; if ( message . data1 ) { len = Math . ceil ( message . data1 . length / 8 ) ; } else { i = 10 ; } for ( /* i */ ; i < 10 ; i ++ ) { var version = versions [ i ] [ ec_level ] ; if ( version . data_len >= len ) { return _deepCopy ( version ) ; } } if ( message . data10 ) { len = Math . ceil ( message . data10 . length / 8 ) ; } else { i = 27 ; } for ( /* i */ ; i < 27 ; i ++ ) { var version = versions [ i ] [ ec_level ] ; if ( version . data_len >= len ) { return _deepCopy ( version ) ; } } len = Math . ceil ( message . data27 . length / 8 ) ; for ( /* i */ ; i < 41 ; i ++ ) { var version = versions [ i ] [ ec_level ] ; if ( version . data_len >= len ) { return _deepCopy ( version ) ; } } throw new Error ( "Too much data" ) ; }
{{{1 Get version template
{{{ 1 Get version template