UNPKG

webdriver-manager-replacement

Version:
33 lines 1.17 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); const path = require("path"); // Change the output directory for all providers. // This will download to the webdriver-manager/downloads directory. exports.OUT_DIR = path.resolve(__dirname, '..', '..', '..', 'downloads'); /** * The provider class with commonmethods by all providers. */ class ProviderClass { /** * Setting values from either the npmrc or config object: * 1. Use the default value * 2. If the npmrc value exists, use the npmrc value * 2. If the value is set in the config, use that instead. * @param key * @param defaultValue * @param providerConfig * @return The value of the variable. The type needs to be fixed. */ setVar(key, defaultValue, providerConfig) { let value = defaultValue; if (process.env[`npm_config_${key}`]) { value = process.env[`npm_config_${key}`]; } if (providerConfig && providerConfig[key]) { value = providerConfig[key]; } return value; } } exports.ProviderClass = ProviderClass; //# sourceMappingURL=provider.js.map