Skip to content

Commit

Permalink
get postal cities countries from pelias-config
Browse files Browse the repository at this point in the history
  • Loading branch information
Florian Lagouche committed May 18, 2021
1 parent f4a3e73 commit 5080feb
Showing 1 changed file with 6 additions and 10 deletions.
16 changes: 6 additions & 10 deletions src/postalCityMap.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,16 +49,12 @@ const USA_ISO_CODES = ['USA','ASM','GUM','MNP','PRI','VIR'];
please open a Pull Request.
**/

// select which ISO country code files are loaded.
const tables = {
'ASM': loadTable('ASM'), // American Samoa
'GUM': loadTable('GUM'), // Guam
'MNP': loadTable('MNP'), // Northern Mariana Islands
'PRI': loadTable('PRI'), // Puerto Rico
'USA': loadTable('USA'), // Unites States of America
'VIR': loadTable('VIR'), // United States Virgin Islands
'NLD': loadTable('NLD'), // The Netherlands
};
const configPostalCitiesCountries = _.get(config, 'imports.adminLookup.postalCitiesCountries', ['ASM','GUM','MNP','PRI','USA','VIR','NLD']);

const tables = {};
configPostalCitiesCountries.forEach(country => {
tables[country] = loadTable(country);
});

// load the file format in to memory
function loadTable(cc){
Expand Down

0 comments on commit 5080feb

Please sign in to comment.