{"size": 562, "ext": "js", "max_stars_repo_path": "resources/js/Helper/TokenParser.js", "max_stars_repo_name": "aledefreitas/teste-tripadvisor-parser", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "resources/js/Helper/TokenParser.js", "max_issues_repo_name": "aledefreitas/teste-tripadvisor-parser", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "resources/js/Helper/TokenParser.js", "max_forks_repo_name": "aledefreitas/teste-tripadvisor-parser", "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": 20.0714285714, "max_line_length": 73, "alphanum_fraction": 0.6352313167}
/**
 * TESTE EPICS - TripAdvisor Parser
 *
 * @author Alexandre de Freitas Caetano <https://github.com/aledefreitas>
 */
var TokenParser = function() {
    let source = null;

    if(document.currentScript) {
        source = document.currentScript.src;
    } else {
        source = document._currentScript().src
    }

    this.token = source.match(new RegExp(/\?session\_id\=(\w+)$/i))[1];
};

/**
 * Retorna o token encontrado
 *
 * @return {string}
 */
TokenParser.prototype.get = function() {
    return this.token;
};

module.exports = new TokenParser();
