Skip to content

Commit

Permalink
fix: Use _ as separator for multiple countries
Browse files Browse the repository at this point in the history
  • Loading branch information
djuric committed Mar 23, 2020
1 parent c12746d commit 2ea003b
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions utils/getCountries.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,12 @@ const getCountries = async (spinner, table, countries) => {
}
};

const parseCountries = (input, separator = "-") => {
const parseCountries = (input, separator = "_") => {
if (typeof input !== "string" || !input.includes(separator)) return false;

let countries = input.split("-").filter(country => country.length > 0);
const countries = input
.split(separator)
.filter(country => country.length > 0);

return countries.length ? countries : false;
};
Expand Down

0 comments on commit 2ea003b

Please sign in to comment.