@shopify/react-i18n
Advanced tools
Comparing version 0.10.4 to 0.10.5
@@ -41,3 +41,3 @@ /// <reference types="react" /> | ||
weekStartDay(argCountry?: I18n['defaultCountry']): Weekdays; | ||
getCurrencySymbol(currencyCode?: string): { | ||
getCurrencySymbol: (currencyCode?: string | undefined) => { | ||
symbol: string; | ||
@@ -44,0 +44,0 @@ prefixed: boolean; |
@@ -16,3 +16,11 @@ "use strict"; | ||
var locale = _a.locale, currency = _a.currency, timezone = _a.timezone, country = _a.country, _b = _a.pseudolocalize, pseudolocalize = _b === void 0 ? false : _b; | ||
var _this = this; | ||
this.translations = translations; | ||
this.getCurrencySymbol = function (currencyCode) { | ||
var currency = currencyCode || _this.defaultCurrency; | ||
if (currency == null) { | ||
throw new errors_1.MissingCurrencyCodeError("No currency code provided. formatCurrency cannot be called without a currency code."); | ||
} | ||
return _this.getCurrencySymbolLocalized(_this.locale, currency); | ||
}; | ||
this.locale = locale; | ||
@@ -155,9 +163,2 @@ this.defaultCountry = country; | ||
}; | ||
I18n.prototype.getCurrencySymbol = function (currencyCode) { | ||
var currency = currencyCode || this.defaultCurrency; | ||
if (currency == null) { | ||
throw new errors_1.MissingCurrencyCodeError("No currency code provided. formatCurrency cannot be called without a currency code."); | ||
} | ||
return this.getCurrencySymbolLocalized(this.locale, currency); | ||
}; | ||
I18n.prototype.getCurrencySymbolLocalized = function (locale, currency) { | ||
@@ -190,5 +191,2 @@ return utilities_1.getCurrencySymbol(locale, { currency: currency }); | ||
tslib_1.__decorate([ | ||
decorators_1.autobind | ||
], I18n.prototype, "getCurrencySymbol", null); | ||
tslib_1.__decorate([ | ||
decorators_1.memoize(function (currency, locale) { return "" + locale + currency; }) | ||
@@ -195,0 +193,0 @@ ], I18n.prototype, "getCurrencySymbolLocalized", null); |
{ | ||
"name": "@shopify/react-i18n", | ||
"version": "0.10.4", | ||
"version": "0.10.5", | ||
"license": "MIT", | ||
@@ -5,0 +5,0 @@ "description": "i18n utilities for React handling translations, formatting, and more.", |
88608
1915