{"size": 677, "ext": "js", "max_stars_repo_path": "src/ProviderManager/ProviderManagerOptions.js", "max_stars_repo_name": "anghootys/provider-manager", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "src/ProviderManager/ProviderManagerOptions.js", "max_issues_repo_name": "anghootys/provider-manager", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "src/ProviderManager/ProviderManagerOptions.js", "max_forks_repo_name": "anghootys/provider-manager", "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": 27.08, "max_line_length": 87, "alphanum_fraction": 0.6248153619}
const {OPTIONS_NOT_VALID, PROVIDERS_LIST_MISSING} = require("./Util/Constants/Errors");

class ProviderManagerOptions {
    constructor(options) {

        // if options list is empty of not valid should throw an error
        if (!options) {
            throw new Error(OPTIONS_NOT_VALID);
        }

        if (!options.providers) {
            if (!options.ignoreErrors)
                throw new Error(PROVIDERS_LIST_MISSING);

            return false;
        }

        // list of providers should be registered here
        this.providers = options.providers || {};
        this.ignoreErrors = !!options.ignoreErrors;

    }
}

module.exports = ProviderManagerOptions;