Code cleanup

This commit is contained in:
Martin Trobäck 2016-11-07 12:53:08 +01:00
parent 0599225f0b
commit 2d44771eb7

View file

@ -11,11 +11,9 @@ const readFile = (dir, file) => {
filename: file
};
if (country.Government['Country name'] && country.Government['Country name']['conventional short form']) {
currentCountry.country = country.Government['Country name']['conventional short form'].text;
} else {
currentCountry.country = '';
}
currentCountry.country = (country.Government['Country name'] &&
country.Government['Country name']['conventional short form']) ?
country.Government['Country name']['conventional short form'].text : '';
countryIndex.push(currentCountry);
};