@formatjs/intl-enumerator 1.4.7 → 1.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/src/get-supported-calendars.js +2 -1
- package/lib/src/get-supported-currencies.js +2 -1
- package/lib/src/get-supported-numbering-systems.js +2 -1
- package/lib/src/get-supported-timezones.js +2 -1
- package/lib/src/get-supported-units.js +2 -1
- package/package.json +3 -5
- package/polyfill.iife.js +286 -71
- package/should-polyfill.js +1 -2
- package/src/get-supported-calendars.js +3 -3
- package/src/get-supported-collations.js +1 -2
- package/src/get-supported-currencies.js +3 -3
- package/src/get-supported-numbering-systems.js +3 -3
- package/src/get-supported-timezones.js +3 -3
- package/src/get-supported-units.js +3 -3
- package/src/index.js +1 -2
|
@@ -1,8 +1,9 @@
|
|
|
1
|
+
import { createMemoizedDateTimeFormat } from '@formatjs/ecma402-abstract';
|
|
1
2
|
import { calendars } from './calendars.generated';
|
|
2
3
|
function isSupportedCalendar(item, locale) {
|
|
3
4
|
if (locale === void 0) { locale = 'en'; }
|
|
4
5
|
try {
|
|
5
|
-
var dateTimeFormat =
|
|
6
|
+
var dateTimeFormat = createMemoizedDateTimeFormat("".concat(locale, "-u-ca-").concat(item));
|
|
6
7
|
var options = dateTimeFormat.resolvedOptions().calendar;
|
|
7
8
|
if (item !== 'gregory' || options !== 'gregory')
|
|
8
9
|
return true;
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
+
import { createMemoizedNumberFormat } from '@formatjs/ecma402-abstract';
|
|
1
2
|
import { currencies } from './currencies.generated';
|
|
2
3
|
function isSupportedCurrency(currency, locale) {
|
|
3
4
|
if (locale === void 0) { locale = 'en'; }
|
|
4
5
|
try {
|
|
5
|
-
var numberFormat =
|
|
6
|
+
var numberFormat = createMemoizedNumberFormat(locale, {
|
|
6
7
|
style: 'currency',
|
|
7
8
|
currencyDisplay: 'name',
|
|
8
9
|
currency: currency,
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
+
import { createMemoizedNumberFormat } from '@formatjs/ecma402-abstract';
|
|
1
2
|
import { numberingSystemNames } from './numbering-systems.generated';
|
|
2
3
|
function isSupportedNumberingSystem(system, locale) {
|
|
3
4
|
if (locale === void 0) { locale = 'en'; }
|
|
4
5
|
try {
|
|
5
|
-
var numberFormat =
|
|
6
|
+
var numberFormat = createMemoizedNumberFormat("".concat(locale, "-u-nu-").concat(system));
|
|
6
7
|
var options = numberFormat.resolvedOptions().numberingSystem;
|
|
7
8
|
if ((options === system && system === 'latn') ||
|
|
8
9
|
numberFormat.format(123) !== '123') {
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
+
import { createMemoizedDateTimeFormat } from '@formatjs/ecma402-abstract';
|
|
1
2
|
import { timezones } from './timezones.generated';
|
|
2
3
|
function isSupported(timeZone, locale) {
|
|
3
4
|
if (locale === void 0) { locale = 'en'; }
|
|
4
5
|
try {
|
|
5
|
-
var formatter =
|
|
6
|
+
var formatter = createMemoizedDateTimeFormat(locale, { timeZone: timeZone });
|
|
6
7
|
return formatter.resolvedOptions().timeZone === timeZone;
|
|
7
8
|
}
|
|
8
9
|
catch (_err) { }
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
+
import { createMemoizedNumberFormat } from '@formatjs/ecma402-abstract';
|
|
1
2
|
import { units } from './units.generated';
|
|
2
3
|
function isSupported(unit, locale) {
|
|
3
4
|
if (locale === void 0) { locale = 'en'; }
|
|
4
5
|
try {
|
|
5
|
-
var formatter =
|
|
6
|
+
var formatter = createMemoizedNumberFormat(locale, { style: 'unit', unit: unit });
|
|
6
7
|
return formatter.resolvedOptions().unit === unit;
|
|
7
8
|
}
|
|
8
9
|
catch (_err) { }
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@formatjs/intl-enumerator",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.6.0",
|
|
4
4
|
"description": "Intl.Enumerator polyfill",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"intl",
|
|
@@ -24,9 +24,7 @@
|
|
|
24
24
|
"url": "https://github.com/formatjs/formatjs/issues"
|
|
25
25
|
},
|
|
26
26
|
"dependencies": {
|
|
27
|
-
"tslib": "^2.
|
|
28
|
-
|
|
29
|
-
"devDependencies": {
|
|
30
|
-
"@formatjs/ecma402-abstract": "2.0.0"
|
|
27
|
+
"tslib": "^2.7.0",
|
|
28
|
+
"@formatjs/ecma402-abstract": "2.2.0"
|
|
31
29
|
}
|
|
32
30
|
}
|
package/polyfill.iife.js
CHANGED
|
@@ -1,20 +1,257 @@
|
|
|
1
1
|
(() => {
|
|
2
|
-
//
|
|
2
|
+
// packages/intl-enumerator/should-polyfill.ts
|
|
3
3
|
function shouldPolyfill() {
|
|
4
4
|
return !("supportedValuesOf" in Intl);
|
|
5
5
|
}
|
|
6
6
|
|
|
7
|
-
//
|
|
8
|
-
var
|
|
7
|
+
// node_modules/.aspect_rules_js/@formatjs+ecma402-abstract@0.0.0/node_modules/@formatjs/ecma402-abstract/lib/262.js
|
|
8
|
+
var MINUTES_PER_HOUR = 60;
|
|
9
|
+
var SECONDS_PER_MINUTE = 60;
|
|
10
|
+
var MS_PER_SECOND = 1e3;
|
|
11
|
+
var MS_PER_MINUTE = MS_PER_SECOND * SECONDS_PER_MINUTE;
|
|
12
|
+
var MS_PER_HOUR = MS_PER_MINUTE * MINUTES_PER_HOUR;
|
|
13
|
+
|
|
14
|
+
// node_modules/.aspect_rules_js/@formatjs+ecma402-abstract@0.0.0/node_modules/@formatjs/ecma402-abstract/lib/IsSanctionedSimpleUnitIdentifier.js
|
|
15
|
+
var SANCTIONED_UNITS = [
|
|
16
|
+
"angle-degree",
|
|
17
|
+
"area-acre",
|
|
18
|
+
"area-hectare",
|
|
19
|
+
"concentr-percent",
|
|
20
|
+
"digital-bit",
|
|
21
|
+
"digital-byte",
|
|
22
|
+
"digital-gigabit",
|
|
23
|
+
"digital-gigabyte",
|
|
24
|
+
"digital-kilobit",
|
|
25
|
+
"digital-kilobyte",
|
|
26
|
+
"digital-megabit",
|
|
27
|
+
"digital-megabyte",
|
|
28
|
+
"digital-petabyte",
|
|
29
|
+
"digital-terabit",
|
|
30
|
+
"digital-terabyte",
|
|
31
|
+
"duration-day",
|
|
32
|
+
"duration-hour",
|
|
33
|
+
"duration-millisecond",
|
|
34
|
+
"duration-minute",
|
|
35
|
+
"duration-month",
|
|
36
|
+
"duration-second",
|
|
37
|
+
"duration-week",
|
|
38
|
+
"duration-year",
|
|
39
|
+
"length-centimeter",
|
|
40
|
+
"length-foot",
|
|
41
|
+
"length-inch",
|
|
42
|
+
"length-kilometer",
|
|
43
|
+
"length-meter",
|
|
44
|
+
"length-mile-scandinavian",
|
|
45
|
+
"length-mile",
|
|
46
|
+
"length-millimeter",
|
|
47
|
+
"length-yard",
|
|
48
|
+
"mass-gram",
|
|
49
|
+
"mass-kilogram",
|
|
50
|
+
"mass-ounce",
|
|
51
|
+
"mass-pound",
|
|
52
|
+
"mass-stone",
|
|
53
|
+
"temperature-celsius",
|
|
54
|
+
"temperature-fahrenheit",
|
|
55
|
+
"volume-fluid-ounce",
|
|
56
|
+
"volume-gallon",
|
|
57
|
+
"volume-liter",
|
|
58
|
+
"volume-milliliter"
|
|
59
|
+
];
|
|
60
|
+
function removeUnitNamespace(unit) {
|
|
61
|
+
return unit.slice(unit.indexOf("-") + 1);
|
|
62
|
+
}
|
|
63
|
+
var SIMPLE_UNITS = SANCTIONED_UNITS.map(removeUnitNamespace);
|
|
64
|
+
|
|
65
|
+
// node_modules/.aspect_rules_js/tslib@2.7.0/node_modules/tslib/tslib.es6.mjs
|
|
66
|
+
var extendStatics = function(d, b) {
|
|
67
|
+
extendStatics = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(d2, b2) {
|
|
68
|
+
d2.__proto__ = b2;
|
|
69
|
+
} || function(d2, b2) {
|
|
70
|
+
for (var p in b2)
|
|
71
|
+
if (Object.prototype.hasOwnProperty.call(b2, p))
|
|
72
|
+
d2[p] = b2[p];
|
|
73
|
+
};
|
|
74
|
+
return extendStatics(d, b);
|
|
75
|
+
};
|
|
76
|
+
function __extends(d, b) {
|
|
77
|
+
if (typeof b !== "function" && b !== null)
|
|
78
|
+
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
79
|
+
extendStatics(d, b);
|
|
80
|
+
function __() {
|
|
81
|
+
this.constructor = d;
|
|
82
|
+
}
|
|
83
|
+
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
84
|
+
}
|
|
85
|
+
function __spreadArray(to, from, pack) {
|
|
86
|
+
if (pack || arguments.length === 2)
|
|
87
|
+
for (var i = 0, l = from.length, ar; i < l; i++) {
|
|
88
|
+
if (ar || !(i in from)) {
|
|
89
|
+
if (!ar)
|
|
90
|
+
ar = Array.prototype.slice.call(from, 0, i);
|
|
91
|
+
ar[i] = from[i];
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
return to.concat(ar || Array.prototype.slice.call(from));
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
// node_modules/.aspect_rules_js/@formatjs+fast-memoize@0.0.0/node_modules/@formatjs/fast-memoize/lib/index.js
|
|
98
|
+
function memoize(fn, options) {
|
|
99
|
+
var cache = options && options.cache ? options.cache : cacheDefault;
|
|
100
|
+
var serializer = options && options.serializer ? options.serializer : serializerDefault;
|
|
101
|
+
var strategy = options && options.strategy ? options.strategy : strategyDefault;
|
|
102
|
+
return strategy(fn, {
|
|
103
|
+
cache,
|
|
104
|
+
serializer
|
|
105
|
+
});
|
|
106
|
+
}
|
|
107
|
+
function isPrimitive(value) {
|
|
108
|
+
return value == null || typeof value === "number" || typeof value === "boolean";
|
|
109
|
+
}
|
|
110
|
+
function monadic(fn, cache, serializer, arg) {
|
|
111
|
+
var cacheKey = isPrimitive(arg) ? arg : serializer(arg);
|
|
112
|
+
var computedValue = cache.get(cacheKey);
|
|
113
|
+
if (typeof computedValue === "undefined") {
|
|
114
|
+
computedValue = fn.call(this, arg);
|
|
115
|
+
cache.set(cacheKey, computedValue);
|
|
116
|
+
}
|
|
117
|
+
return computedValue;
|
|
118
|
+
}
|
|
119
|
+
function variadic(fn, cache, serializer) {
|
|
120
|
+
var args = Array.prototype.slice.call(arguments, 3);
|
|
121
|
+
var cacheKey = serializer(args);
|
|
122
|
+
var computedValue = cache.get(cacheKey);
|
|
123
|
+
if (typeof computedValue === "undefined") {
|
|
124
|
+
computedValue = fn.apply(this, args);
|
|
125
|
+
cache.set(cacheKey, computedValue);
|
|
126
|
+
}
|
|
127
|
+
return computedValue;
|
|
128
|
+
}
|
|
129
|
+
function assemble(fn, context, strategy, cache, serialize) {
|
|
130
|
+
return strategy.bind(context, fn, cache, serialize);
|
|
131
|
+
}
|
|
132
|
+
function strategyDefault(fn, options) {
|
|
133
|
+
var strategy = fn.length === 1 ? monadic : variadic;
|
|
134
|
+
return assemble(fn, this, strategy, options.cache.create(), options.serializer);
|
|
135
|
+
}
|
|
136
|
+
function strategyVariadic(fn, options) {
|
|
137
|
+
return assemble(fn, this, variadic, options.cache.create(), options.serializer);
|
|
138
|
+
}
|
|
139
|
+
function strategyMonadic(fn, options) {
|
|
140
|
+
return assemble(fn, this, monadic, options.cache.create(), options.serializer);
|
|
141
|
+
}
|
|
142
|
+
var serializerDefault = function() {
|
|
143
|
+
return JSON.stringify(arguments);
|
|
144
|
+
};
|
|
145
|
+
function ObjectWithoutPrototypeCache() {
|
|
146
|
+
this.cache = /* @__PURE__ */ Object.create(null);
|
|
147
|
+
}
|
|
148
|
+
ObjectWithoutPrototypeCache.prototype.get = function(key) {
|
|
149
|
+
return this.cache[key];
|
|
150
|
+
};
|
|
151
|
+
ObjectWithoutPrototypeCache.prototype.set = function(key, value) {
|
|
152
|
+
this.cache[key] = value;
|
|
153
|
+
};
|
|
154
|
+
var cacheDefault = {
|
|
155
|
+
create: function create() {
|
|
156
|
+
return new ObjectWithoutPrototypeCache();
|
|
157
|
+
}
|
|
158
|
+
};
|
|
159
|
+
var strategies = {
|
|
160
|
+
variadic: strategyVariadic,
|
|
161
|
+
monadic: strategyMonadic
|
|
162
|
+
};
|
|
9
163
|
|
|
10
|
-
//
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
164
|
+
// node_modules/.aspect_rules_js/@formatjs+ecma402-abstract@0.0.0/node_modules/@formatjs/ecma402-abstract/lib/utils.js
|
|
165
|
+
var createMemoizedNumberFormat = memoize(function() {
|
|
166
|
+
var _a;
|
|
167
|
+
var args = [];
|
|
168
|
+
for (var _i = 0; _i < arguments.length; _i++) {
|
|
169
|
+
args[_i] = arguments[_i];
|
|
14
170
|
}
|
|
171
|
+
return new ((_a = Intl.NumberFormat).bind.apply(_a, __spreadArray([void 0], args, false)))();
|
|
172
|
+
}, {
|
|
173
|
+
strategy: strategies.variadic
|
|
174
|
+
});
|
|
175
|
+
var createMemoizedDateTimeFormat = memoize(function() {
|
|
176
|
+
var _a;
|
|
177
|
+
var args = [];
|
|
178
|
+
for (var _i = 0; _i < arguments.length; _i++) {
|
|
179
|
+
args[_i] = arguments[_i];
|
|
180
|
+
}
|
|
181
|
+
return new ((_a = Intl.DateTimeFormat).bind.apply(_a, __spreadArray([void 0], args, false)))();
|
|
182
|
+
}, {
|
|
183
|
+
strategy: strategies.variadic
|
|
184
|
+
});
|
|
185
|
+
var createMemoizedPluralRules = memoize(function() {
|
|
186
|
+
var _a;
|
|
187
|
+
var args = [];
|
|
188
|
+
for (var _i = 0; _i < arguments.length; _i++) {
|
|
189
|
+
args[_i] = arguments[_i];
|
|
190
|
+
}
|
|
191
|
+
return new ((_a = Intl.PluralRules).bind.apply(_a, __spreadArray([void 0], args, false)))();
|
|
192
|
+
}, {
|
|
193
|
+
strategy: strategies.variadic
|
|
194
|
+
});
|
|
195
|
+
var createMemoizedLocale = memoize(function() {
|
|
196
|
+
var _a;
|
|
197
|
+
var args = [];
|
|
198
|
+
for (var _i = 0; _i < arguments.length; _i++) {
|
|
199
|
+
args[_i] = arguments[_i];
|
|
200
|
+
}
|
|
201
|
+
return new ((_a = Intl.Locale).bind.apply(_a, __spreadArray([void 0], args, false)))();
|
|
202
|
+
}, {
|
|
203
|
+
strategy: strategies.variadic
|
|
204
|
+
});
|
|
205
|
+
var createMemoizedListFormat = memoize(function() {
|
|
206
|
+
var _a;
|
|
207
|
+
var args = [];
|
|
208
|
+
for (var _i = 0; _i < arguments.length; _i++) {
|
|
209
|
+
args[_i] = arguments[_i];
|
|
210
|
+
}
|
|
211
|
+
return new ((_a = Intl.ListFormat).bind.apply(_a, __spreadArray([void 0], args, false)))();
|
|
212
|
+
}, {
|
|
213
|
+
strategy: strategies.variadic
|
|
214
|
+
});
|
|
215
|
+
|
|
216
|
+
// node_modules/.aspect_rules_js/@formatjs+ecma402-abstract@0.0.0/node_modules/@formatjs/ecma402-abstract/lib/regex.generated.js
|
|
217
|
+
var S_UNICODE_REGEX = /[\$\+<->\^`\|~\xA2-\xA6\xA8\xA9\xAC\xAE-\xB1\xB4\xB8\xD7\xF7\u02C2-\u02C5\u02D2-\u02DF\u02E5-\u02EB\u02ED\u02EF-\u02FF\u0375\u0384\u0385\u03F6\u0482\u058D-\u058F\u0606-\u0608\u060B\u060E\u060F\u06DE\u06E9\u06FD\u06FE\u07F6\u07FE\u07FF\u09F2\u09F3\u09FA\u09FB\u0AF1\u0B70\u0BF3-\u0BFA\u0C7F\u0D4F\u0D79\u0E3F\u0F01-\u0F03\u0F13\u0F15-\u0F17\u0F1A-\u0F1F\u0F34\u0F36\u0F38\u0FBE-\u0FC5\u0FC7-\u0FCC\u0FCE\u0FCF\u0FD5-\u0FD8\u109E\u109F\u1390-\u1399\u166D\u17DB\u1940\u19DE-\u19FF\u1B61-\u1B6A\u1B74-\u1B7C\u1FBD\u1FBF-\u1FC1\u1FCD-\u1FCF\u1FDD-\u1FDF\u1FED-\u1FEF\u1FFD\u1FFE\u2044\u2052\u207A-\u207C\u208A-\u208C\u20A0-\u20BF\u2100\u2101\u2103-\u2106\u2108\u2109\u2114\u2116-\u2118\u211E-\u2123\u2125\u2127\u2129\u212E\u213A\u213B\u2140-\u2144\u214A-\u214D\u214F\u218A\u218B\u2190-\u2307\u230C-\u2328\u232B-\u2426\u2440-\u244A\u249C-\u24E9\u2500-\u2767\u2794-\u27C4\u27C7-\u27E5\u27F0-\u2982\u2999-\u29D7\u29DC-\u29FB\u29FE-\u2B73\u2B76-\u2B95\u2B97-\u2BFF\u2CE5-\u2CEA\u2E50\u2E51\u2E80-\u2E99\u2E9B-\u2EF3\u2F00-\u2FD5\u2FF0-\u2FFB\u3004\u3012\u3013\u3020\u3036\u3037\u303E\u303F\u309B\u309C\u3190\u3191\u3196-\u319F\u31C0-\u31E3\u3200-\u321E\u322A-\u3247\u3250\u3260-\u327F\u328A-\u32B0\u32C0-\u33FF\u4DC0-\u4DFF\uA490-\uA4C6\uA700-\uA716\uA720\uA721\uA789\uA78A\uA828-\uA82B\uA836-\uA839\uAA77-\uAA79\uAB5B\uAB6A\uAB6B\uFB29\uFBB2-\uFBC1\uFDFC\uFDFD\uFE62\uFE64-\uFE66\uFE69\uFF04\uFF0B\uFF1C-\uFF1E\uFF3E\uFF40\uFF5C\uFF5E\uFFE0-\uFFE6\uFFE8-\uFFEE\uFFFC\uFFFD]|\uD800[\uDD37-\uDD3F\uDD79-\uDD89\uDD8C-\uDD8E\uDD90-\uDD9C\uDDA0\uDDD0-\uDDFC]|\uD802[\uDC77\uDC78\uDEC8]|\uD805\uDF3F|\uD807[\uDFD5-\uDFF1]|\uD81A[\uDF3C-\uDF3F\uDF45]|\uD82F\uDC9C|\uD834[\uDC00-\uDCF5\uDD00-\uDD26\uDD29-\uDD64\uDD6A-\uDD6C\uDD83\uDD84\uDD8C-\uDDA9\uDDAE-\uDDE8\uDE00-\uDE41\uDE45\uDF00-\uDF56]|\uD835[\uDEC1\uDEDB\uDEFB\uDF15\uDF35\uDF4F\uDF6F\uDF89\uDFA9\uDFC3]|\uD836[\uDC00-\uDDFF\uDE37-\uDE3A\uDE6D-\uDE74\uDE76-\uDE83\uDE85\uDE86]|\uD838[\uDD4F\uDEFF]|\uD83B[\uDCAC\uDCB0\uDD2E\uDEF0\uDEF1]|\uD83C[\uDC00-\uDC2B\uDC30-\uDC93\uDCA0-\uDCAE\uDCB1-\uDCBF\uDCC1-\uDCCF\uDCD1-\uDCF5\uDD0D-\uDDAD\uDDE6-\uDE02\uDE10-\uDE3B\uDE40-\uDE48\uDE50\uDE51\uDE60-\uDE65\uDF00-\uDFFF]|\uD83D[\uDC00-\uDED7\uDEE0-\uDEEC\uDEF0-\uDEFC\uDF00-\uDF73\uDF80-\uDFD8\uDFE0-\uDFEB]|\uD83E[\uDC00-\uDC0B\uDC10-\uDC47\uDC50-\uDC59\uDC60-\uDC87\uDC90-\uDCAD\uDCB0\uDCB1\uDD00-\uDD78\uDD7A-\uDDCB\uDDCD-\uDE53\uDE60-\uDE6D\uDE70-\uDE74\uDE78-\uDE7A\uDE80-\uDE86\uDE90-\uDEA8\uDEB0-\uDEB6\uDEC0-\uDEC2\uDED0-\uDED6\uDF00-\uDF92\uDF94-\uDFCA]/;
|
|
218
|
+
|
|
219
|
+
// node_modules/.aspect_rules_js/@formatjs+ecma402-abstract@0.0.0/node_modules/@formatjs/ecma402-abstract/lib/NumberFormat/format_to_parts.js
|
|
220
|
+
var CARET_S_UNICODE_REGEX = new RegExp("^".concat(S_UNICODE_REGEX.source));
|
|
221
|
+
var S_DOLLAR_UNICODE_REGEX = new RegExp("".concat(S_UNICODE_REGEX.source, "$"));
|
|
222
|
+
|
|
223
|
+
// node_modules/.aspect_rules_js/@formatjs+ecma402-abstract@0.0.0/node_modules/@formatjs/ecma402-abstract/lib/data.js
|
|
224
|
+
var MissingLocaleDataError = (
|
|
225
|
+
/** @class */
|
|
226
|
+
function(_super) {
|
|
227
|
+
__extends(MissingLocaleDataError2, _super);
|
|
228
|
+
function MissingLocaleDataError2() {
|
|
229
|
+
var _this = _super !== null && _super.apply(this, arguments) || this;
|
|
230
|
+
_this.type = "MISSING_LOCALE_DATA";
|
|
231
|
+
return _this;
|
|
232
|
+
}
|
|
233
|
+
return MissingLocaleDataError2;
|
|
234
|
+
}(Error)
|
|
235
|
+
);
|
|
236
|
+
|
|
237
|
+
// node_modules/.aspect_rules_js/@formatjs+ecma402-abstract@0.0.0/node_modules/@formatjs/ecma402-abstract/lib/types/date-time.js
|
|
238
|
+
var RangePatternType;
|
|
239
|
+
(function(RangePatternType2) {
|
|
240
|
+
RangePatternType2["startRange"] = "startRange";
|
|
241
|
+
RangePatternType2["shared"] = "shared";
|
|
242
|
+
RangePatternType2["endRange"] = "endRange";
|
|
243
|
+
})(RangePatternType || (RangePatternType = {}));
|
|
244
|
+
|
|
245
|
+
// packages/intl-enumerator/src/calendars.generated.ts
|
|
246
|
+
var calendars = ["buddhist", "chinese", "coptic", "dangi", "ethioaa", "ethiopic", "gregory", "hebrew", "indian", "islamic", "islamic-civil", "islamic-rgsa", "islamic-tbla", "islamic-umalqura", "islamicc", "iso8601", "japanese", "persian", "roc"];
|
|
247
|
+
|
|
248
|
+
// packages/intl-enumerator/src/get-supported-calendars.ts
|
|
249
|
+
function isSupportedCalendar(item, locale = "en") {
|
|
15
250
|
try {
|
|
16
|
-
|
|
17
|
-
|
|
251
|
+
const dateTimeFormat = createMemoizedDateTimeFormat(
|
|
252
|
+
`${locale}-u-ca-${item}`
|
|
253
|
+
);
|
|
254
|
+
const options = dateTimeFormat.resolvedOptions().calendar;
|
|
18
255
|
if (item !== "gregory" || options !== "gregory")
|
|
19
256
|
return true;
|
|
20
257
|
} catch (_err) {
|
|
@@ -22,46 +259,38 @@
|
|
|
22
259
|
return false;
|
|
23
260
|
}
|
|
24
261
|
function getSupportedCalendars(localePrefix) {
|
|
25
|
-
return calendars.filter(
|
|
26
|
-
|
|
27
|
-
|
|
262
|
+
return calendars.filter(
|
|
263
|
+
(calendar) => isSupportedCalendar(calendar, localePrefix)
|
|
264
|
+
);
|
|
28
265
|
}
|
|
29
266
|
|
|
30
|
-
//
|
|
267
|
+
// packages/intl-enumerator/src/collations.generated.ts
|
|
31
268
|
var collations = ["big5han", "compat", "dict", "direct", "ducet", "emoji", "eor", "gb2312", "phonebk", "phonetic", "pinyin", "reformed", "search", "searchjl", "standard", "stroke", "trad", "unihan", "zhuyin"];
|
|
32
269
|
|
|
33
|
-
//
|
|
34
|
-
function isSupported(collation, locale) {
|
|
35
|
-
if (locale === void 0) {
|
|
36
|
-
locale = "en";
|
|
37
|
-
}
|
|
270
|
+
// packages/intl-enumerator/src/get-supported-collations.ts
|
|
271
|
+
function isSupported(collation, locale = "en") {
|
|
38
272
|
try {
|
|
39
|
-
return Intl.Collator(
|
|
273
|
+
return Intl.Collator(`${locale}-u-co-${collation}`).resolvedOptions().collation === collation;
|
|
40
274
|
} catch (_err) {
|
|
41
275
|
}
|
|
42
276
|
return false;
|
|
43
277
|
}
|
|
44
278
|
function getSupportedCollations(locale) {
|
|
45
|
-
return collations.filter(
|
|
46
|
-
return isSupported(collation, locale);
|
|
47
|
-
});
|
|
279
|
+
return collations.filter((collation) => isSupported(collation, locale));
|
|
48
280
|
}
|
|
49
281
|
|
|
50
|
-
//
|
|
282
|
+
// packages/intl-enumerator/src/currencies.generated.ts
|
|
51
283
|
var currencies = ["ADP", "AED", "AFA", "AFN", "ALK", "ALL", "AMD", "ANG", "AOA", "AOK", "AON", "AOR", "ARA", "ARL", "ARM", "ARP", "ARS", "ATS", "AUD", "AWG", "AZM", "AZN", "BAD", "BAM", "BAN", "BBD", "BDT", "BEC", "BEF", "BEL", "BGL", "BGM", "BGN", "BGO", "BHD", "BIF", "BMD", "BND", "BOB", "BOL", "BOP", "BOV", "BRB", "BRC", "BRE", "BRL", "BRN", "BRR", "BRZ", "BSD", "BTN", "BUK", "BWP", "BYB", "BYN", "BYR", "BZD", "CAD", "CDF", "CHE", "CHF", "CHW", "CLE", "CLF", "CLP", "CNH", "CNX", "CNY", "COP", "COU", "CRC", "CSD", "CSK", "CUC", "CUP", "CVE", "CYP", "CZK", "DDM", "DEM", "DJF", "DKK", "DOP", "DZD", "ECS", "ECV", "EEK", "EGP", "ERN", "ESA", "ESB", "ESP", "ETB", "EUR", "FIM", "FJD", "FKP", "FRF", "GBP", "GEK", "GEL", "GHC", "GHS", "GIP", "GMD", "GNF", "GNS", "GQE", "GRD", "GTQ", "GWE", "GWP", "GYD", "HKD", "HNL", "HRD", "HRK", "HTG", "HUF", "IDR", "IEP", "ILP", "ILR", "ILS", "INR", "IQD", "IRR", "ISJ", "ISK", "ITL", "JMD", "JOD", "JPY", "KES", "KGS", "KHR", "KMF", "KPW", "KRH", "KRO", "KRW", "KWD", "KYD", "KZT", "LAK", "LBP", "LKR", "LRD", "LSL", "LTL", "LTT", "LUC", "LUF", "LUL", "LVL", "LVR", "LYD", "MAD", "MAF", "MCF", "MDC", "MDL", "MGA", "MGF", "MKD", "MKN", "MLF", "MMK", "MNT", "MOP", "MRO", "MRU", "MTL", "MTP", "MUR", "MVP", "MVR", "MWK", "MXN", "MXP", "MXV", "MYR", "MZE", "MZM", "MZN", "NAD", "NGN", "NIC", "NIO", "NLG", "NOK", "NPR", "NZD", "OMR", "PAB", "PEI", "PEN", "PES", "PGK", "PHP", "PKR", "PLN", "PLZ", "PTE", "PYG", "QAR", "RHD", "ROL", "RON", "RSD", "RUB", "RUR", "RWF", "SAR", "SBD", "SCR", "SDD", "SDG", "SDP", "SEK", "SGD", "SHP", "SIT", "SKK", "SLE", "SLL", "SOS", "SRD", "SRG", "SSP", "STD", "STN", "SUR", "SVC", "SYP", "SZL", "THB", "TJR", "TJS", "TMM", "TMT", "TND", "TOP", "TPE", "TRL", "TRY", "TTD", "TWD", "TZS", "UAH", "UAK", "UGS", "UGX", "USD", "USN", "USS", "UYI", "UYP", "UYU", "UYW", "UZS", "VEB", "VED", "VEF", "VES", "VND", "VNN", "VUV", "WST", "XAF", "XAG", "XAU", "XBA", "XBB", "XBC", "XBD", "XCD", "XDR", "XEU", "XFO", "XFU", "XOF", "XPD", "XPF", "XPT", "XRE", "XSU", "XTS", "XUA", "XXX", "YDD", "YER", "YUD", "YUM", "YUN", "YUR", "ZAL", "ZAR", "ZMK", "ZMW", "ZRN", "ZRZ", "ZWD", "ZWL", "ZWR"];
|
|
52
284
|
|
|
53
|
-
//
|
|
54
|
-
function isSupportedCurrency(currency, locale) {
|
|
55
|
-
if (locale === void 0) {
|
|
56
|
-
locale = "en";
|
|
57
|
-
}
|
|
285
|
+
// packages/intl-enumerator/src/get-supported-currencies.ts
|
|
286
|
+
function isSupportedCurrency(currency, locale = "en") {
|
|
58
287
|
try {
|
|
59
|
-
|
|
288
|
+
const numberFormat = createMemoizedNumberFormat(locale, {
|
|
60
289
|
style: "currency",
|
|
61
290
|
currencyDisplay: "name",
|
|
62
291
|
currency
|
|
63
292
|
});
|
|
64
|
-
|
|
293
|
+
const format = numberFormat.format(123);
|
|
65
294
|
if (format.substring(0, 3) !== currency && format.substring(format.length - 3) !== currency) {
|
|
66
295
|
return true;
|
|
67
296
|
}
|
|
@@ -70,19 +299,18 @@
|
|
|
70
299
|
return false;
|
|
71
300
|
}
|
|
72
301
|
function getSupportedCurrencies(locale) {
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
for (
|
|
76
|
-
var currency = currencies_1[_i];
|
|
302
|
+
const ATOZ = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
|
|
303
|
+
const supportedCurrencies = [];
|
|
304
|
+
for (const currency of currencies) {
|
|
77
305
|
if (currency.length === 3) {
|
|
78
306
|
if (isSupportedCurrency(currency, locale)) {
|
|
79
307
|
supportedCurrencies.push(currency);
|
|
80
308
|
}
|
|
81
309
|
} else if (currency.length === 5 && currency[3] === "~") {
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
for (
|
|
85
|
-
|
|
310
|
+
const start = ATOZ.indexOf(currency[2]);
|
|
311
|
+
const end = ATOZ.indexOf(currency[4]);
|
|
312
|
+
for (let i = start; i <= end; i++) {
|
|
313
|
+
const currentCurrency = currency.substring(0, 2) + ATOZ[i];
|
|
86
314
|
if (isSupportedCurrency(currentCurrency, locale)) {
|
|
87
315
|
supportedCurrencies.push(currentCurrency);
|
|
88
316
|
}
|
|
@@ -92,17 +320,14 @@
|
|
|
92
320
|
return supportedCurrencies;
|
|
93
321
|
}
|
|
94
322
|
|
|
95
|
-
//
|
|
323
|
+
// packages/intl-enumerator/src/numbering-systems.generated.ts
|
|
96
324
|
var numberingSystemNames = ["adlm", "ahom", "arab", "arabext", "armn", "armnlow", "bali", "beng", "bhks", "brah", "cakm", "cham", "cyrl", "deva", "diak", "ethi", "fullwide", "geor", "gong", "gonm", "grek", "greklow", "gujr", "guru", "hanidays", "hanidec", "hans", "hansfin", "hant", "hantfin", "hebr", "hmng", "hmnp", "java", "jpan", "jpanfin", "jpanyear", "kali", "kawi", "khmr", "knda", "lana", "lanatham", "laoo", "latn", "lepc", "limb", "mathbold", "mathdbl", "mathmono", "mathsanb", "mathsans", "mlym", "modi", "mong", "mroo", "mtei", "mymr", "mymrshan", "mymrtlng", "nagm", "newa", "nkoo", "olck", "orya", "osma", "rohg", "roman", "romanlow", "saur", "segment", "shrd", "sind", "sinh", "sora", "sund", "takr", "talu", "taml", "tamldec", "telu", "thai", "tibt", "tirh", "tnsa", "vaii", "wara", "wcho"];
|
|
97
325
|
|
|
98
|
-
//
|
|
99
|
-
function isSupportedNumberingSystem(system, locale) {
|
|
100
|
-
if (locale === void 0) {
|
|
101
|
-
locale = "en";
|
|
102
|
-
}
|
|
326
|
+
// packages/intl-enumerator/src/get-supported-numbering-systems.ts
|
|
327
|
+
function isSupportedNumberingSystem(system, locale = "en") {
|
|
103
328
|
try {
|
|
104
|
-
|
|
105
|
-
|
|
329
|
+
const numberFormat = createMemoizedNumberFormat(`${locale}-u-nu-${system}`);
|
|
330
|
+
const options = numberFormat.resolvedOptions().numberingSystem;
|
|
106
331
|
if (options === system && system === "latn" || numberFormat.format(123) !== "123") {
|
|
107
332
|
return true;
|
|
108
333
|
}
|
|
@@ -111,54 +336,44 @@
|
|
|
111
336
|
return false;
|
|
112
337
|
}
|
|
113
338
|
function getSupportedNumberingSystems(locale) {
|
|
114
|
-
return numberingSystemNames.filter(
|
|
115
|
-
|
|
116
|
-
|
|
339
|
+
return numberingSystemNames.filter(
|
|
340
|
+
(numberingSystemName) => isSupportedNumberingSystem(numberingSystemName, locale)
|
|
341
|
+
);
|
|
117
342
|
}
|
|
118
343
|
|
|
119
|
-
//
|
|
344
|
+
// packages/intl-enumerator/src/timezones.generated.ts
|
|
120
345
|
var timezones = ["Africa/Abidjan", "Africa/Accra", "Africa/Addis_Ababa", "Africa/Algiers", "Africa/Asmara", "Africa/Bamako", "Africa/Bangui", "Africa/Banjul", "Africa/Bissau", "Africa/Blantyre", "Africa/Brazzaville", "Africa/Bujumbura", "Africa/Cairo", "Africa/Casablanca", "Africa/Ceuta", "Africa/Conakry", "Africa/Dakar", "Africa/Dar_es_Salaam", "Africa/Djibouti", "Africa/Douala", "Africa/El_Aaiun", "Africa/Freetown", "Africa/Gaborone", "Africa/Harare", "Africa/Johannesburg", "Africa/Juba", "Africa/Kampala", "Africa/Khartoum", "Africa/Kigali", "Africa/Kinshasa", "Africa/Lagos", "Africa/Libreville", "Africa/Lome", "Africa/Luanda", "Africa/Lubumbashi", "Africa/Lusaka", "Africa/Malabo", "Africa/Maputo", "Africa/Maseru", "Africa/Mbabane", "Africa/Mogadishu", "Africa/Monrovia", "Africa/Nairobi", "Africa/Ndjamena", "Africa/Niamey", "Africa/Nouakchott", "Africa/Ouagadougou", "Africa/Porto-Novo", "Africa/Sao_Tome", "Africa/Tripoli", "Africa/Tunis", "Africa/Windhoek", "America/Adak", "America/Anchorage", "America/Anguilla", "America/Antigua", "America/Araguaina", "America/Argentina/Buenos_Aires", "America/Argentina/Catamarca", "America/Argentina/Cordoba", "America/Argentina/Jujuy", "America/Argentina/La_Rioja", "America/Argentina/Mendoza", "America/Argentina/Rio_Gallegos", "America/Argentina/Salta", "America/Argentina/San_Juan", "America/Argentina/San_Luis", "America/Argentina/Tucuman", "America/Argentina/Ushuaia", "America/Aruba", "America/Asuncion", "America/Atikokan", "America/Bahia_Banderas", "America/Bahia", "America/Barbados", "America/Belem", "America/Belize", "America/Blanc-Sablon", "America/Boa_Vista", "America/Bogota", "America/Boise", "America/Cambridge_Bay", "America/Campo_Grande", "America/Cancun", "America/Caracas", "America/Cayenne", "America/Cayman", "America/Chicago", "America/Chihuahua", "America/Ciudad_Juarez", "America/Costa_Rica", "America/Creston", "America/Cuiaba", "America/Curacao", "America/Danmarkshavn", "America/Dawson_Creek", "America/Dawson", "America/Denver", "America/Detroit", "America/Dominica", "America/Edmonton", "America/Eirunepe", "America/El_Salvador", "America/Fort_Nelson", "America/Fortaleza", "America/Glace_Bay", "America/Goose_Bay", "America/Grand_Turk", "America/Grenada", "America/Guadeloupe", "America/Guatemala", "America/Guayaquil", "America/Guyana", "America/Halifax", "America/Havana", "America/Hermosillo", "America/Indiana/Indianapolis", "America/Indiana/Knox", "America/Indiana/Marengo", "America/Indiana/Petersburg", "America/Indiana/Tell_City", "America/Indiana/Vevay", "America/Indiana/Vincennes", "America/Indiana/Winamac", "America/Inuvik", "America/Iqaluit", "America/Jamaica", "America/Juneau", "America/Kentucky/Louisville", "America/Kentucky/Monticello", "America/Kralendijk", "America/La_Paz", "America/Lima", "America/Los_Angeles", "America/Lower_Princes", "America/Maceio", "America/Managua", "America/Manaus", "America/Marigot", "America/Martinique", "America/Matamoros", "America/Mazatlan", "America/Menominee", "America/Merida", "America/Metlakatla", "America/Mexico_City", "America/Miquelon", "America/Moncton", "America/Monterrey", "America/Montevideo", "America/Montserrat", "America/Nassau", "America/New_York", "America/Nipigon", "America/Nome", "America/Noronha", "America/North_Dakota/Beulah", "America/North_Dakota/Center", "America/North_Dakota/New_Salem", "America/Nuuk", "America/Ojinaga", "America/Panama", "America/Pangnirtung", "America/Paramaribo", "America/Phoenix", "America/Port_of_Spain", "America/Port-au-Prince", "America/Porto_Velho", "America/Puerto_Rico", "America/Punta_Arenas", "America/Rainy_River", "America/Rankin_Inlet", "America/Recife", "America/Regina", "America/Resolute", "America/Rio_Branco", "America/Santarem", "America/Santiago", "America/Santo_Domingo", "America/Sao_Paulo", "America/Scoresbysund", "America/Sitka", "America/St_Barthelemy", "America/St_Johns", "America/St_Kitts", "America/St_Lucia", "America/St_Thomas", "America/St_Vincent", "America/Swift_Current", "America/Tegucigalpa", "America/Thule", "America/Thunder_Bay", "America/Tijuana", "America/Toronto", "America/Tortola", "America/Vancouver", "America/Whitehorse", "America/Winnipeg", "America/Yakutat", "America/Yellowknife", "Antarctica/Casey", "Antarctica/Davis", "Antarctica/DumontDUrville", "Antarctica/Macquarie", "Antarctica/Mawson", "Antarctica/McMurdo", "Antarctica/Palmer", "Antarctica/Rothera", "Antarctica/Syowa", "Antarctica/Troll", "Antarctica/Vostok", "Arctic/Longyearbyen", "Asia/Aden", "Asia/Almaty", "Asia/Amman", "Asia/Anadyr", "Asia/Aqtau", "Asia/Aqtobe", "Asia/Ashgabat", "Asia/Atyrau", "Asia/Baghdad", "Asia/Bahrain", "Asia/Baku", "Asia/Bangkok", "Asia/Barnaul", "Asia/Beirut", "Asia/Bishkek", "Asia/Brunei", "Asia/Chita", "Asia/Choibalsan", "Asia/Colombo", "Asia/Damascus", "Asia/Dhaka", "Asia/Dili", "Asia/Dubai", "Asia/Dushanbe", "Asia/Famagusta", "Asia/Gaza", "Asia/Hebron", "Asia/Ho_Chi_Minh", "Asia/Hong_Kong", "Asia/Hovd", "Asia/Irkutsk", "Asia/Jakarta", "Asia/Jayapura", "Asia/Jerusalem", "Asia/Kabul", "Asia/Kamchatka", "Asia/Karachi", "Asia/Kathmandu", "Asia/Khandyga", "Asia/Kolkata", "Asia/Krasnoyarsk", "Asia/Kuala_Lumpur", "Asia/Kuching", "Asia/Kuwait", "Asia/Macau", "Asia/Magadan", "Asia/Makassar", "Asia/Manila", "Asia/Muscat", "Asia/Nicosia", "Asia/Novokuznetsk", "Asia/Novosibirsk", "Asia/Omsk", "Asia/Oral", "Asia/Phnom_Penh", "Asia/Pontianak", "Asia/Pyongyang", "Asia/Qatar", "Asia/Qostanay", "Asia/Qyzylorda", "Asia/Riyadh", "Asia/Sakhalin", "Asia/Samarkand", "Asia/Seoul", "Asia/Shanghai", "Asia/Singapore", "Asia/Srednekolymsk", "Asia/Taipei", "Asia/Tashkent", "Asia/Tbilisi", "Asia/Tehran", "Asia/Thimphu", "Asia/Tokyo", "Asia/Tomsk", "Asia/Ulaanbaatar", "Asia/Urumqi", "Asia/Ust-Nera", "Asia/Vientiane", "Asia/Vladivostok", "Asia/Yakutsk", "Asia/Yangon", "Asia/Yekaterinburg", "Asia/Yerevan", "Atlantic/Azores", "Atlantic/Bermuda", "Atlantic/Canary", "Atlantic/Cape_Verde", "Atlantic/Faroe", "Atlantic/Madeira", "Atlantic/Reykjavik", "Atlantic/South_Georgia", "Atlantic/St_Helena", "Atlantic/Stanley", "Australia/Adelaide", "Australia/Brisbane", "Australia/Broken_Hill", "Australia/Currie", "Australia/Darwin", "Australia/Eucla", "Australia/Hobart", "Australia/Lindeman", "Australia/Lord_Howe", "Australia/Melbourne", "Australia/Perth", "Australia/Sydney", "Europe/Amsterdam", "Europe/Andorra", "Europe/Astrakhan", "Europe/Athens", "Europe/Belgrade", "Europe/Berlin", "Europe/Bratislava", "Europe/Brussels", "Europe/Bucharest", "Europe/Budapest", "Europe/Busingen", "Europe/Chisinau", "Europe/Copenhagen", "Europe/Dublin", "Europe/Gibraltar", "Europe/Guernsey", "Europe/Helsinki", "Europe/Isle_of_Man", "Europe/Istanbul", "Europe/Jersey", "Europe/Kaliningrad", "Europe/Kyiv", "Europe/Kirov", "Europe/Lisbon", "Europe/Ljubljana", "Europe/London", "Europe/Luxembourg", "Europe/Madrid", "Europe/Malta", "Europe/Mariehamn", "Europe/Minsk", "Europe/Monaco", "Europe/Moscow", "Europe/Oslo", "Europe/Paris", "Europe/Podgorica", "Europe/Prague", "Europe/Riga", "Europe/Rome", "Europe/Samara", "Europe/San_Marino", "Europe/Sarajevo", "Europe/Saratov", "Europe/Simferopol", "Europe/Skopje", "Europe/Sofia", "Europe/Stockholm", "Europe/Tallinn", "Europe/Tirane", "Europe/Ulyanovsk", "Europe/Uzhgorod", "Europe/Vaduz", "Europe/Vatican", "Europe/Vienna", "Europe/Vilnius", "Europe/Volgograd", "Europe/Warsaw", "Europe/Zagreb", "Europe/Zaporozhye", "Europe/Zurich", "Indian/Antananarivo", "Indian/Chagos", "Indian/Christmas", "Indian/Cocos", "Indian/Comoro", "Indian/Kerguelen", "Indian/Mahe", "Indian/Maldives", "Indian/Mauritius", "Indian/Mayotte", "Indian/Reunion", "Pacific/Apia", "Pacific/Auckland", "Pacific/Bougainville", "Pacific/Chatham", "Pacific/Chuuk", "Pacific/Easter", "Pacific/Efate", "Pacific/Kanton", "Pacific/Fakaofo", "Pacific/Fiji", "Pacific/Funafuti", "Pacific/Galapagos", "Pacific/Gambier", "Pacific/Guadalcanal", "Pacific/Guam", "Pacific/Honolulu", "Pacific/Kiritimati", "Pacific/Kosrae", "Pacific/Kwajalein", "Pacific/Majuro", "Pacific/Marquesas", "Pacific/Midway", "Pacific/Nauru", "Pacific/Niue", "Pacific/Norfolk", "Pacific/Noumea", "Pacific/Pago_Pago", "Pacific/Palau", "Pacific/Pitcairn", "Pacific/Pohnpei", "Pacific/Port_Moresby", "Pacific/Rarotonga", "Pacific/Saipan", "Pacific/Tahiti", "Pacific/Tarawa", "Pacific/Tongatapu", "Pacific/Wake", "Pacific/Wallis"];
|
|
121
346
|
|
|
122
|
-
//
|
|
123
|
-
function isSupported2(timeZone, locale) {
|
|
124
|
-
if (locale === void 0) {
|
|
125
|
-
locale = "en";
|
|
126
|
-
}
|
|
347
|
+
// packages/intl-enumerator/src/get-supported-timezones.ts
|
|
348
|
+
function isSupported2(timeZone, locale = "en") {
|
|
127
349
|
try {
|
|
128
|
-
|
|
350
|
+
const formatter = createMemoizedDateTimeFormat(locale, { timeZone });
|
|
129
351
|
return formatter.resolvedOptions().timeZone === timeZone;
|
|
130
352
|
} catch (_err) {
|
|
131
353
|
}
|
|
132
354
|
return false;
|
|
133
355
|
}
|
|
134
356
|
function getSupportedTimeZones(locale) {
|
|
135
|
-
return timezones.filter(
|
|
136
|
-
return isSupported2(timezone, locale);
|
|
137
|
-
});
|
|
357
|
+
return timezones.filter((timezone) => isSupported2(timezone, locale));
|
|
138
358
|
}
|
|
139
359
|
|
|
140
|
-
//
|
|
360
|
+
// packages/intl-enumerator/src/units.generated.ts
|
|
141
361
|
var units = ["degree", "acre", "hectare", "percent", "bit", "byte", "gigabit", "gigabyte", "kilobit", "kilobyte", "megabit", "megabyte", "petabyte", "terabit", "terabyte", "day", "hour", "millisecond", "minute", "month", "second", "week", "year", "centimeter", "foot", "inch", "kilometer", "meter", "mile-scandinavian", "mile", "millimeter", "yard", "gram", "kilogram", "ounce", "pound", "stone", "celsius", "fahrenheit", "fluid-ounce", "gallon", "liter", "milliliter"];
|
|
142
362
|
|
|
143
|
-
//
|
|
144
|
-
function isSupported3(unit, locale) {
|
|
145
|
-
if (locale === void 0) {
|
|
146
|
-
locale = "en";
|
|
147
|
-
}
|
|
363
|
+
// packages/intl-enumerator/src/get-supported-units.ts
|
|
364
|
+
function isSupported3(unit, locale = "en") {
|
|
148
365
|
try {
|
|
149
|
-
|
|
366
|
+
const formatter = createMemoizedNumberFormat(locale, { style: "unit", unit });
|
|
150
367
|
return formatter.resolvedOptions().unit === unit;
|
|
151
368
|
} catch (_err) {
|
|
152
369
|
}
|
|
153
370
|
return false;
|
|
154
371
|
}
|
|
155
372
|
function getSupportedUnits(locale) {
|
|
156
|
-
return units.filter(
|
|
157
|
-
return isSupported3(unit, locale);
|
|
158
|
-
});
|
|
373
|
+
return units.filter((unit) => isSupported3(unit, locale));
|
|
159
374
|
}
|
|
160
375
|
|
|
161
|
-
//
|
|
376
|
+
// packages/intl-enumerator/src/index.ts
|
|
162
377
|
function supportedValuesOf(key, locale) {
|
|
163
378
|
switch (key) {
|
|
164
379
|
case "calendar":
|
|
@@ -178,7 +393,7 @@
|
|
|
178
393
|
}
|
|
179
394
|
}
|
|
180
395
|
|
|
181
|
-
//
|
|
396
|
+
// packages/intl-enumerator/polyfill.ts
|
|
182
397
|
if (shouldPolyfill()) {
|
|
183
398
|
Object.defineProperty(Intl, "supportedValuesOf", {
|
|
184
399
|
value: supportedValuesOf,
|
package/should-polyfill.js
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.shouldPolyfill =
|
|
3
|
+
exports.shouldPolyfill = shouldPolyfill;
|
|
4
4
|
function shouldPolyfill() {
|
|
5
5
|
return !('supportedValuesOf' in Intl);
|
|
6
6
|
}
|
|
7
|
-
exports.shouldPolyfill = shouldPolyfill;
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.getSupportedCalendars =
|
|
3
|
+
exports.getSupportedCalendars = getSupportedCalendars;
|
|
4
|
+
var ecma402_abstract_1 = require("@formatjs/ecma402-abstract");
|
|
4
5
|
var calendars_generated_1 = require("./calendars.generated");
|
|
5
6
|
function isSupportedCalendar(item, locale) {
|
|
6
7
|
if (locale === void 0) { locale = 'en'; }
|
|
7
8
|
try {
|
|
8
|
-
var dateTimeFormat =
|
|
9
|
+
var dateTimeFormat = (0, ecma402_abstract_1.createMemoizedDateTimeFormat)("".concat(locale, "-u-ca-").concat(item));
|
|
9
10
|
var options = dateTimeFormat.resolvedOptions().calendar;
|
|
10
11
|
if (item !== 'gregory' || options !== 'gregory')
|
|
11
12
|
return true;
|
|
@@ -18,4 +19,3 @@ function getSupportedCalendars(localePrefix) {
|
|
|
18
19
|
return isSupportedCalendar(calendar, localePrefix);
|
|
19
20
|
});
|
|
20
21
|
}
|
|
21
|
-
exports.getSupportedCalendars = getSupportedCalendars;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.getSupportedCollations =
|
|
3
|
+
exports.getSupportedCollations = getSupportedCollations;
|
|
4
4
|
var collations_generated_1 = require("./collations.generated");
|
|
5
5
|
function isSupported(collation, locale) {
|
|
6
6
|
if (locale === void 0) { locale = 'en'; }
|
|
@@ -14,4 +14,3 @@ function isSupported(collation, locale) {
|
|
|
14
14
|
function getSupportedCollations(locale) {
|
|
15
15
|
return collations_generated_1.collations.filter(function (collation) { return isSupported(collation, locale); });
|
|
16
16
|
}
|
|
17
|
-
exports.getSupportedCollations = getSupportedCollations;
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.getSupportedCurrencies =
|
|
3
|
+
exports.getSupportedCurrencies = getSupportedCurrencies;
|
|
4
|
+
var ecma402_abstract_1 = require("@formatjs/ecma402-abstract");
|
|
4
5
|
var currencies_generated_1 = require("./currencies.generated");
|
|
5
6
|
function isSupportedCurrency(currency, locale) {
|
|
6
7
|
if (locale === void 0) { locale = 'en'; }
|
|
7
8
|
try {
|
|
8
|
-
var numberFormat =
|
|
9
|
+
var numberFormat = (0, ecma402_abstract_1.createMemoizedNumberFormat)(locale, {
|
|
9
10
|
style: 'currency',
|
|
10
11
|
currencyDisplay: 'name',
|
|
11
12
|
currency: currency,
|
|
@@ -42,4 +43,3 @@ function getSupportedCurrencies(locale) {
|
|
|
42
43
|
}
|
|
43
44
|
return supportedCurrencies;
|
|
44
45
|
}
|
|
45
|
-
exports.getSupportedCurrencies = getSupportedCurrencies;
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.getSupportedNumberingSystems =
|
|
3
|
+
exports.getSupportedNumberingSystems = getSupportedNumberingSystems;
|
|
4
|
+
var ecma402_abstract_1 = require("@formatjs/ecma402-abstract");
|
|
4
5
|
var numbering_systems_generated_1 = require("./numbering-systems.generated");
|
|
5
6
|
function isSupportedNumberingSystem(system, locale) {
|
|
6
7
|
if (locale === void 0) { locale = 'en'; }
|
|
7
8
|
try {
|
|
8
|
-
var numberFormat =
|
|
9
|
+
var numberFormat = (0, ecma402_abstract_1.createMemoizedNumberFormat)("".concat(locale, "-u-nu-").concat(system));
|
|
9
10
|
var options = numberFormat.resolvedOptions().numberingSystem;
|
|
10
11
|
if ((options === system && system === 'latn') ||
|
|
11
12
|
numberFormat.format(123) !== '123') {
|
|
@@ -20,4 +21,3 @@ function getSupportedNumberingSystems(locale) {
|
|
|
20
21
|
return isSupportedNumberingSystem(numberingSystemName, locale);
|
|
21
22
|
});
|
|
22
23
|
}
|
|
23
|
-
exports.getSupportedNumberingSystems = getSupportedNumberingSystems;
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.getSupportedTimeZones =
|
|
3
|
+
exports.getSupportedTimeZones = getSupportedTimeZones;
|
|
4
|
+
var ecma402_abstract_1 = require("@formatjs/ecma402-abstract");
|
|
4
5
|
var timezones_generated_1 = require("./timezones.generated");
|
|
5
6
|
function isSupported(timeZone, locale) {
|
|
6
7
|
if (locale === void 0) { locale = 'en'; }
|
|
7
8
|
try {
|
|
8
|
-
var formatter =
|
|
9
|
+
var formatter = (0, ecma402_abstract_1.createMemoizedDateTimeFormat)(locale, { timeZone: timeZone });
|
|
9
10
|
return formatter.resolvedOptions().timeZone === timeZone;
|
|
10
11
|
}
|
|
11
12
|
catch (_err) { }
|
|
@@ -14,4 +15,3 @@ function isSupported(timeZone, locale) {
|
|
|
14
15
|
function getSupportedTimeZones(locale) {
|
|
15
16
|
return timezones_generated_1.timezones.filter(function (timezone) { return isSupported(timezone, locale); });
|
|
16
17
|
}
|
|
17
|
-
exports.getSupportedTimeZones = getSupportedTimeZones;
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.getSupportedUnits =
|
|
3
|
+
exports.getSupportedUnits = getSupportedUnits;
|
|
4
|
+
var ecma402_abstract_1 = require("@formatjs/ecma402-abstract");
|
|
4
5
|
var units_generated_1 = require("./units.generated");
|
|
5
6
|
function isSupported(unit, locale) {
|
|
6
7
|
if (locale === void 0) { locale = 'en'; }
|
|
7
8
|
try {
|
|
8
|
-
var formatter =
|
|
9
|
+
var formatter = (0, ecma402_abstract_1.createMemoizedNumberFormat)(locale, { style: 'unit', unit: unit });
|
|
9
10
|
return formatter.resolvedOptions().unit === unit;
|
|
10
11
|
}
|
|
11
12
|
catch (_err) { }
|
|
@@ -14,4 +15,3 @@ function isSupported(unit, locale) {
|
|
|
14
15
|
function getSupportedUnits(locale) {
|
|
15
16
|
return units_generated_1.units.filter(function (unit) { return isSupported(unit, locale); });
|
|
16
17
|
}
|
|
17
|
-
exports.getSupportedUnits = getSupportedUnits;
|
package/src/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.supportedValuesOf =
|
|
3
|
+
exports.supportedValuesOf = supportedValuesOf;
|
|
4
4
|
var get_supported_calendars_1 = require("./get-supported-calendars");
|
|
5
5
|
var get_supported_collations_1 = require("./get-supported-collations");
|
|
6
6
|
var get_supported_currencies_1 = require("./get-supported-currencies");
|
|
@@ -25,4 +25,3 @@ function supportedValuesOf(key, locale) {
|
|
|
25
25
|
throw RangeError('Invalid key: ' + key);
|
|
26
26
|
}
|
|
27
27
|
}
|
|
28
|
-
exports.supportedValuesOf = supportedValuesOf;
|