Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
const runSetup = (cmdOpts = {}) => {
const {
browser, configPath, editorArgs, editorPath, overwriteConfig,
overwriteEditorConfig,
} = cmdOpts;
const opt = {
hostDescription: HOST_DESC,
hostName: HOST,
chromeExtensionIds: [EXT_CHROME_ID],
webExtensionIds: [EXT_WEB_ID],
callback: handleSetupCallback,
};
const setup = new Setup(opt);
if (isString(browser) && browser.length) {
setup.browser = browser.trim();
}
if (isString(configPath) && configPath.length) {
setup.configPath = configPath.trim();
}
if (overwriteConfig) {
setup.overwriteConfig = !!overwriteConfig;
}
setupOpts.set("editorArgs", editorArgs);
setupOpts.set("editorPath", editorPath);
setupOpts.set("overwriteEditorConfig", overwriteEditorConfig);
return setup.run();
};
const runSetup = (cmdOpts = {}) => {
const {
browser, configPath, editorArgs, editorPath, overwriteConfig,
overwriteEditorConfig,
} = cmdOpts;
const opt = {
hostDescription: HOST_DESC,
hostName: HOST,
chromeExtensionIds: [EXT_CHROME_ID],
webExtensionIds: [EXT_WEB_ID],
callback: handleSetupCallback,
};
const setup = new Setup(opt);
if (isString(browser) && browser.length) {
setup.browser = browser.trim();
} else {
const excludedBrowsers = ["thunderbird"];
setup.supportedBrowsers = setup.supportedBrowsers.filter(item =>
!excludedBrowsers.includes(item.toLowerCase()),
);
}
if (isString(configPath) && configPath.length) {
setup.configPath = configPath.trim();
}
if (overwriteConfig) {
setup.overwriteConfig = !!overwriteConfig;
}
setupOpts.set("editorArgs", editorArgs);
setupOpts.set("editorPath", editorPath);