@paypal/sdk-client
Advanced tools
Comparing version
{ | ||
"name": "@paypal/sdk-client", | ||
"version": "4.0.152", | ||
"version": "4.0.153", | ||
"description": "Shared config between PayPal/Braintree.", | ||
@@ -61,3 +61,3 @@ "main": "index.js", | ||
"babel-core": "7.0.0-bridge.0", | ||
"cheerio": "1.0.0-rc.3", | ||
"cheerio": "1.0.0-rc.9", | ||
"esdoc": "1.1.0", | ||
@@ -64,0 +64,0 @@ "esdoc-flow-type-plugin": "1.1.0", |
@@ -220,7 +220,16 @@ /* @flow */ | ||
for (const { country, lang } of getBrowserLocales()) { | ||
// $FlowFixMe | ||
if (COUNTRY_LANGS.hasOwnProperty(country) && COUNTRY_LANGS[country].indexOf(lang) !== -1) { | ||
// $FlowFixMe | ||
for (let { country, lang } of getBrowserLocales()) { | ||
country = country && COUNTRY[country]; | ||
lang = lang && LANG[lang.toUpperCase()]; | ||
if (country && lang && COUNTRY_LANGS[country] && COUNTRY_LANGS[country].indexOf(lang) !== -1) { | ||
return { country, lang }; | ||
} else if (lang) { | ||
// We infer country from language if there is only one possible country match | ||
const possibleCountries = Object.keys(COUNTRY_LANGS).filter(c => COUNTRY_LANGS[c].some(l => l === lang)); | ||
if (possibleCountries.length === 1) { | ||
const possibleCountry = possibleCountries[0]; | ||
return { country: possibleCountry, lang }; | ||
} | ||
} | ||
@@ -227,0 +236,0 @@ } |
79560
0.61%1578
0.45%