mirror of https://gitgud.io/fatchan/jschan.git
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
20 lines
609 B
20 lines
609 B
'use strict';
|
|
|
|
const countries = require('i18n-iso-countries')
|
|
, countryNamesMap = countries.getNames('en')
|
|
, countryCodes = ['XX', 'T1', 'TOR']
|
|
.concat(Object.keys(countryNamesMap));
|
|
|
|
//this dumb library conveniently includes 2 names for some countries...
|
|
Object.entries(countryNamesMap)
|
|
.filter(e => Array.isArray(e[1])) //for any country with an array of names,
|
|
.forEach(c => countryNamesMap[c[0]] = c[1][0]) //use the first name
|
|
|
|
countryNamesMap['XX'] = 'Unknown';
|
|
countryNamesMap['T1'] = 'Tor Exit Node';
|
|
countryNamesMap['TOR'] = 'Tor Onion';
|
|
|
|
module.exports = {
|
|
countryNamesMap,
|
|
countryCodes,
|
|
}
|
|
|