{"size": 689, "ext": "js", "max_stars_repo_path": "RegisterBimehCOR/utils/checkMeliCode.js", "max_stars_repo_name": "kharazian/whatsapp-web.js", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "RegisterBimehCOR/utils/checkMeliCode.js", "max_issues_repo_name": "kharazian/whatsapp-web.js", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "RegisterBimehCOR/utils/checkMeliCode.js", "max_forks_repo_name": "kharazian/whatsapp-web.js", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": null, "max_issues_count": null, "max_forks_count": null, "avg_line_length": 24.6071428571, "max_line_length": 57, "alphanum_fraction": 0.4557329463}
const checkCodeMeli = function myfunction(codeMeli) {    
    codeMeli = codeMeli.replace(' ','');
    if (isNaN(codeMeli)) {
        return false;
    } else if (codeMeli == "") {
        return false;
    } else if (codeMeli.length > 10)  {
        return false;
    }
    else {
        codeMeli = codeMeli.padStart(10, "0");
        var yy = 0;
        var yv = 0;
        for (let i = 0; i < codeMeli.length; i++) {
            yv = codeMeli[i] * (codeMeli.length - i);
            yy += yv;
        }
        var x = yy % 11;
        if (x === 0) {
            return true;
        } else {
            return false;
        }
        yy = 0;
    }
}

module.exports = checkCodeMeli;