intl-messageformat
Advanced tools
Comparing version 9.13.0 to 10.0.1
@@ -16,3 +16,3 @@ import { parse, MessageFormatElement } from '@formatjs/icu-messageformat-parser'; | ||
private readonly locales; | ||
private readonly resolvedLocale; | ||
private readonly resolvedLocale?; | ||
private readonly formatters; | ||
@@ -31,3 +31,3 @@ private readonly formats; | ||
static get defaultLocale(): string; | ||
static resolveLocale: (locales: string | string[]) => Intl.Locale; | ||
static resolveLocale: (locales: string | string[]) => Intl.Locale | undefined; | ||
static __parse: typeof parse | undefined; | ||
@@ -34,0 +34,0 @@ static formats: Formats; |
@@ -119,5 +119,9 @@ /* | ||
}; | ||
this.resolvedOptions = function () { return ({ | ||
locale: _this.resolvedLocale.toString(), | ||
}); }; | ||
this.resolvedOptions = function () { | ||
var _a; | ||
return ({ | ||
locale: ((_a = _this.resolvedLocale) === null || _a === void 0 ? void 0 : _a.toString()) || | ||
Intl.NumberFormat.supportedLocalesOf(_this.locales)[0], | ||
}); | ||
}; | ||
this.getAst = function () { return _this.ast; }; | ||
@@ -163,2 +167,5 @@ // Defined first because it's used to build the format pattern. | ||
IntlMessageFormat.resolveLocale = function (locales) { | ||
if (typeof Intl.Locale === 'undefined') { | ||
return; | ||
} | ||
var supportedLocales = Intl.NumberFormat.supportedLocalesOf(locales); | ||
@@ -165,0 +172,0 @@ if (supportedLocales.length > 0) { |
{ | ||
"name": "intl-messageformat", | ||
"version": "9.13.0", | ||
"version": "10.0.1", | ||
"description": "Formats ICU Message strings with number, date, plural, and select placeholders to create localized messages.", | ||
@@ -34,6 +34,6 @@ "keywords": [ | ||
"dependencies": { | ||
"@formatjs/ecma402-abstract": "1.11.4", | ||
"@formatjs/fast-memoize": "1.2.1", | ||
"@formatjs/icu-messageformat-parser": "2.1.0", | ||
"tslib": "^2.1.0" | ||
"@formatjs/ecma402-abstract": "1.11.6", | ||
"@formatjs/fast-memoize": "1.2.3", | ||
"@formatjs/icu-messageformat-parser": "2.1.2", | ||
"tslib": "2.4.0" | ||
}, | ||
@@ -40,0 +40,0 @@ "sideEffects": false, |
@@ -16,3 +16,3 @@ import { parse, MessageFormatElement } from '@formatjs/icu-messageformat-parser'; | ||
private readonly locales; | ||
private readonly resolvedLocale; | ||
private readonly resolvedLocale?; | ||
private readonly formatters; | ||
@@ -31,3 +31,3 @@ private readonly formats; | ||
static get defaultLocale(): string; | ||
static resolveLocale: (locales: string | string[]) => Intl.Locale; | ||
static resolveLocale: (locales: string | string[]) => Intl.Locale | undefined; | ||
static __parse: typeof parse | undefined; | ||
@@ -34,0 +34,0 @@ static formats: Formats; |
@@ -122,5 +122,9 @@ "use strict"; | ||
}; | ||
this.resolvedOptions = function () { return ({ | ||
locale: _this.resolvedLocale.toString(), | ||
}); }; | ||
this.resolvedOptions = function () { | ||
var _a; | ||
return ({ | ||
locale: ((_a = _this.resolvedLocale) === null || _a === void 0 ? void 0 : _a.toString()) || | ||
Intl.NumberFormat.supportedLocalesOf(_this.locales)[0], | ||
}); | ||
}; | ||
this.getAst = function () { return _this.ast; }; | ||
@@ -166,2 +170,5 @@ // Defined first because it's used to build the format pattern. | ||
IntlMessageFormat.resolveLocale = function (locales) { | ||
if (typeof Intl.Locale === 'undefined') { | ||
return; | ||
} | ||
var supportedLocales = Intl.NumberFormat.supportedLocalesOf(locales); | ||
@@ -168,0 +175,0 @@ if (supportedLocales.length > 0) { |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
294730
8658
+ Added@formatjs/ecma402-abstract@1.11.6(transitive)
+ Added@formatjs/fast-memoize@1.2.3(transitive)
+ Added@formatjs/icu-messageformat-parser@2.1.2(transitive)
+ Added@formatjs/icu-skeleton-parser@1.3.8(transitive)
+ Added@formatjs/intl-localematcher@0.2.27(transitive)
+ Addedtslib@2.4.0(transitive)
- Removed@formatjs/ecma402-abstract@1.11.4(transitive)
- Removed@formatjs/fast-memoize@1.2.1(transitive)
- Removed@formatjs/icu-messageformat-parser@2.1.0(transitive)
- Removed@formatjs/icu-skeleton-parser@1.3.6(transitive)
- Removed@formatjs/intl-localematcher@0.2.25(transitive)
- Removedtslib@2.7.0(transitive)
Updated@formatjs/fast-memoize@1.2.3
Updatedtslib@2.4.0