Skip to content

Commit

Permalink
fix: default selected DBs to valid DBs when no config
Browse files Browse the repository at this point in the history
  • Loading branch information
sgarner committed Mar 15, 2024
1 parent 7389cd6 commit 7372f74
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,10 +58,11 @@ const getLicense = () => {
};

const getSelectedDbs = () => {
const config = getConfig();
const selected = config['selected-dbs'];
const valids = ['City', 'Country', 'ASN'];
if (!selected) return valids;

const config = getConfig();
const selected = config?.['selected-dbs'] ?? valids;

if (!Array.isArray(selected)) {
console.error('selected-dbs property must have be an array.');
process.exit(1);
Expand Down

0 comments on commit 7372f74

Please sign in to comment.