add function to normalize config default values
This commit is contained in:
parent
80ad15b54e
commit
bfd9cdc4d6
8
normalize-config.js
Normal file
8
normalize-config.js
Normal file
|
@ -0,0 +1,8 @@
|
|||
import { config } from "./config";
|
||||
|
||||
export const normalize_configs = (default_token, default_base_url, default_download_dir) => {
|
||||
if(config.base_url === "") {config.base_url = default_base_url};
|
||||
if(config.token === "") {config.default_token = default_token};
|
||||
if(config.downloadDir === "") {config.downloadDir = default_download_dir}
|
||||
}
|
||||
|
Loading…
Reference in a new issue