File tree Expand file tree Collapse file tree 3 files changed +4
-273
lines changed Expand file tree Collapse file tree 3 files changed +4
-273
lines changed Original file line number Diff line number Diff line change 4848 "alpha-shape" : " ^1.0.0" ,
4949 "arraytools" : " ^1.0.0" ,
5050 "convex-hull" : " ^1.0.3" ,
51+ "country-regex" : " ^1.0.0" ,
5152 "d3" : " ^3.5.12" ,
5253 "delaunay-triangulate" : " ^1.1.6" ,
5354 "es6-promise" : " ^3.0.2" ,
Load Diff This file was deleted.
Original file line number Diff line number Diff line change 99
1010'use strict' ;
1111
12+ var countryRegex = require ( 'country-regex' ) ;
1213var locationUtils = module . exports = { } ;
1314
1415var Plotly = require ( '../plotly' ) ;
1516
16- // an hash object iso3 to regex string
17- var countryNameData = require ( '../constants/country-name_to_iso3' ) ;
18-
1917// make list of all country iso3 ids from at runtime
20- var countryIds = Object . keys ( countryNameData ) ;
18+ var countryIds = Object . keys ( countryRegex ) ;
2119
2220var locationmodeToIdFinder = {
2321 'ISO-3' : Plotly . Lib . identity ,
@@ -51,7 +49,7 @@ function countryNameToISO3(countryName) {
5149
5250 for ( var i = 0 ; i < countryIds . length ; i ++ ) {
5351 iso3 = countryIds [ i ] ;
54- regex = new RegExp ( countryNameData [ iso3 ] ) ;
52+ regex = new RegExp ( countryRegex [ iso3 ] ) ;
5553
5654 if ( regex . test ( countryName . toLowerCase ( ) ) ) return iso3 ;
5755 }
You can’t perform that action at this time.
0 commit comments