"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.TokenHandlerFactory = void 0;
const FileTokenHandler_1 = require("./FileTokenHandler");
const OptionsTokenHandler_1 = require("./OptionsTokenHandler");
class TokenHandlerFactory {
    static createTokenHandler(options) {
        if (isOptionsPassed(options, 'access_token', 'url')) {
            return new OptionsTokenHandler_1.OptionsTokenHandler(options);
        }
        return new FileTokenHandler_1.FileTokenHandler();
    }
}
exports.TokenHandlerFactory = TokenHandlerFactory;
function isOptionsPassed(options, ...keys) {
    return options && [].every.call(keys, (key) => {
        return options[key] !== undefined;
    });
}
//# sourceMappingURL=TokenHandlerFactory.js.map