add function to normalize config default values

This commit is contained in:
worm 2022-12-30 16:27:09 -08:00
parent 80ad15b54e
commit bfd9cdc4d6

8
normalize-config.js Normal file
View 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}
}