Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
function extractWorldInfo () {
// Extract data
var territoryInfoByTerritoryId = cldr.extractTerritories();
var territoryContainmentGroups = cldr.extractTerritoryContainmentGroups();
// Build convenience arrays
var numericTerritoryIdByAlpha2Code = {};
Object.keys(territoryInfoByTerritoryId).forEach(function (type) {
var numericCode = territoryInfoByTerritoryId[type].numericCode;
if (numericCode) {
numericTerritoryIdByAlpha2Code[type] = numericCode;
}
});
var containedTerritoriesByAlpha2TerritoryId = {};
var parentRegionIdByTerritoryId = {};
var numericRegionIdByTerritoryId = {};