intl-locales-supported
Advanced tools
Comparing version 1.4.7 to 1.4.8
@@ -6,2 +6,13 @@ # Change Log | ||
## [1.4.8](https://github.com/formatjs/formatjs/compare/intl-locales-supported@1.4.7...intl-locales-supported@1.4.8) (2019-09-13) | ||
### Bug Fixes | ||
* **intl-locales-supported:** Confirm all requested ctors are present ([#174](https://github.com/formatjs/formatjs/issues/174)) ([f720ba6](https://github.com/formatjs/formatjs/commit/f720ba6)) | ||
## [1.4.7](https://github.com/formatjs/formatjs/compare/intl-locales-supported@1.4.6...intl-locales-supported@1.4.7) (2019-09-03) | ||
@@ -8,0 +19,0 @@ |
@@ -18,12 +18,11 @@ "use strict"; | ||
} | ||
// Per https://github.com/formatjs/formatjs/issues/151 | ||
if (!constructorsToCheck) { | ||
constructorsToCheck = [ | ||
Intl.DateTimeFormat, | ||
Intl.NumberFormat, | ||
Intl.PluralRules, | ||
]; | ||
} | ||
var intlConstructors = constructorsToCheck.filter(Boolean); | ||
if (intlConstructors.length === 0) { | ||
var intlConstructors = constructorsToCheck || [ | ||
Intl.DateTimeFormat, | ||
Intl.NumberFormat, | ||
Intl.PluralRules, | ||
]; | ||
intlConstructors = intlConstructors.filter(Boolean); | ||
if (intlConstructors.length === 0 || | ||
(constructorsToCheck && | ||
intlConstructors.length !== constructorsToCheck.length)) { | ||
return false; | ||
@@ -30,0 +29,0 @@ } |
@@ -16,12 +16,11 @@ /* | ||
} | ||
// Per https://github.com/formatjs/formatjs/issues/151 | ||
if (!constructorsToCheck) { | ||
constructorsToCheck = [ | ||
Intl.DateTimeFormat, | ||
Intl.NumberFormat, | ||
Intl.PluralRules, | ||
]; | ||
} | ||
var intlConstructors = constructorsToCheck.filter(Boolean); | ||
if (intlConstructors.length === 0) { | ||
var intlConstructors = constructorsToCheck || [ | ||
Intl.DateTimeFormat, | ||
Intl.NumberFormat, | ||
Intl.PluralRules, | ||
]; | ||
intlConstructors = intlConstructors.filter(Boolean); | ||
if (intlConstructors.length === 0 || | ||
(constructorsToCheck && | ||
intlConstructors.length !== constructorsToCheck.length)) { | ||
return false; | ||
@@ -28,0 +27,0 @@ } |
{ | ||
"name": "intl-locales-supported", | ||
"version": "1.4.7", | ||
"version": "1.4.8", | ||
"description": "Utility to help you polyfill the Node.js runtime when the Intl APIs are missing, or if the built-in Intl is missing locale data that you need.", | ||
@@ -31,3 +31,3 @@ "main": "dist/index.js", | ||
}, | ||
"gitHead": "a00fcd57d1ade294efa943daee587c638223e572" | ||
"gitHead": "78355538d14153fa3e52d483b7840106573c3fc7" | ||
} |
@@ -27,14 +27,15 @@ /* | ||
// Per https://github.com/formatjs/formatjs/issues/151 | ||
if (!constructorsToCheck) { | ||
constructorsToCheck = [ | ||
Intl.DateTimeFormat, | ||
Intl.NumberFormat, | ||
Intl.PluralRules, | ||
]; | ||
} | ||
let intlConstructors = constructorsToCheck || [ | ||
Intl.DateTimeFormat, | ||
Intl.NumberFormat, | ||
Intl.PluralRules, | ||
]; | ||
const intlConstructors = constructorsToCheck.filter(Boolean); | ||
intlConstructors = intlConstructors.filter(Boolean); | ||
if (intlConstructors.length === 0) { | ||
if ( | ||
intlConstructors.length === 0 || | ||
(constructorsToCheck && | ||
intlConstructors.length !== constructorsToCheck.length) | ||
) { | ||
return false; | ||
@@ -41,0 +42,0 @@ } |
14089
112