@formatjs/intl-displaynames 5.2.5 → 5.2.6
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/abstract/CanonicalCodeForDisplayNames.js +4 -4
- package/index.js +21 -21
- package/lib/abstract/CanonicalCodeForDisplayNames.js +1 -1
- package/lib/index.js +3 -3
- package/package.json +2 -2
- package/polyfill.iife.js +26 -29
- package/polyfill.js +1 -1
|
@@ -12,7 +12,7 @@ function isUnicodeScriptSubtag(script) {
|
|
|
12
12
|
}
|
|
13
13
|
function CanonicalCodeForDisplayNames(type, code) {
|
|
14
14
|
if (type === 'language') {
|
|
15
|
-
return ecma402_abstract_1.CanonicalizeLocaleList([code])[0];
|
|
15
|
+
return (0, ecma402_abstract_1.CanonicalizeLocaleList)([code])[0];
|
|
16
16
|
}
|
|
17
17
|
if (type === 'region') {
|
|
18
18
|
if (!isUnicodeRegionSubtag(code)) {
|
|
@@ -24,10 +24,10 @@ function CanonicalCodeForDisplayNames(type, code) {
|
|
|
24
24
|
if (!isUnicodeScriptSubtag(code)) {
|
|
25
25
|
throw RangeError('invalid script');
|
|
26
26
|
}
|
|
27
|
-
return ""
|
|
27
|
+
return "".concat(code[0].toUpperCase()).concat(code.slice(1).toLowerCase());
|
|
28
28
|
}
|
|
29
|
-
ecma402_abstract_1.invariant(type === 'currency', 'invalid type');
|
|
30
|
-
if (!ecma402_abstract_1.IsWellFormedCurrencyCode(code)) {
|
|
29
|
+
(0, ecma402_abstract_1.invariant)(type === 'currency', 'invalid type');
|
|
30
|
+
if (!(0, ecma402_abstract_1.IsWellFormedCurrencyCode)(code)) {
|
|
31
31
|
throw RangeError('invalid currency');
|
|
32
32
|
}
|
|
33
33
|
return code.toUpperCase();
|
package/index.js
CHANGED
|
@@ -11,39 +11,39 @@ var DisplayNames = /** @class */ (function () {
|
|
|
11
11
|
if (_newTarget === undefined) {
|
|
12
12
|
throw TypeError("Constructor Intl.DisplayNames requires 'new'");
|
|
13
13
|
}
|
|
14
|
-
var requestedLocales = ecma402_abstract_1.CanonicalizeLocaleList(locales);
|
|
15
|
-
options = ecma402_abstract_1.GetOptionsObject(options);
|
|
14
|
+
var requestedLocales = (0, ecma402_abstract_1.CanonicalizeLocaleList)(locales);
|
|
15
|
+
options = (0, ecma402_abstract_1.GetOptionsObject)(options);
|
|
16
16
|
var opt = Object.create(null);
|
|
17
17
|
var localeData = DisplayNames.localeData;
|
|
18
|
-
var matcher = ecma402_abstract_1.GetOption(options, 'localeMatcher', 'string', ['lookup', 'best fit'], 'best fit');
|
|
18
|
+
var matcher = (0, ecma402_abstract_1.GetOption)(options, 'localeMatcher', 'string', ['lookup', 'best fit'], 'best fit');
|
|
19
19
|
opt.localeMatcher = matcher;
|
|
20
|
-
var r = intl_localematcher_1.ResolveLocale(DisplayNames.availableLocales, requestedLocales, opt, [], // there is no relevantExtensionKeys
|
|
20
|
+
var r = (0, intl_localematcher_1.ResolveLocale)(DisplayNames.availableLocales, requestedLocales, opt, [], // there is no relevantExtensionKeys
|
|
21
21
|
DisplayNames.localeData, DisplayNames.getDefaultLocale);
|
|
22
|
-
var style = ecma402_abstract_1.GetOption(options, 'style', 'string', ['narrow', 'short', 'long'], 'long');
|
|
22
|
+
var style = (0, ecma402_abstract_1.GetOption)(options, 'style', 'string', ['narrow', 'short', 'long'], 'long');
|
|
23
23
|
setSlot(this, 'style', style);
|
|
24
|
-
var type = ecma402_abstract_1.GetOption(options, 'type', 'string', ['language', 'currency', 'region', 'script'], undefined);
|
|
24
|
+
var type = (0, ecma402_abstract_1.GetOption)(options, 'type', 'string', ['language', 'currency', 'region', 'script'], undefined);
|
|
25
25
|
if (type === undefined) {
|
|
26
26
|
throw TypeError("Intl.DisplayNames constructor requires \"type\" option");
|
|
27
27
|
}
|
|
28
28
|
setSlot(this, 'type', type);
|
|
29
|
-
var fallback = ecma402_abstract_1.GetOption(options, 'fallback', 'string', ['code', 'none'], 'code');
|
|
29
|
+
var fallback = (0, ecma402_abstract_1.GetOption)(options, 'fallback', 'string', ['code', 'none'], 'code');
|
|
30
30
|
setSlot(this, 'fallback', fallback);
|
|
31
31
|
setSlot(this, 'locale', r.locale);
|
|
32
32
|
var dataLocale = r.dataLocale;
|
|
33
33
|
var dataLocaleData = localeData[dataLocale];
|
|
34
|
-
ecma402_abstract_1.invariant(!!dataLocaleData, "Missing locale data for "
|
|
34
|
+
(0, ecma402_abstract_1.invariant)(!!dataLocaleData, "Missing locale data for ".concat(dataLocale));
|
|
35
35
|
setSlot(this, 'localeData', dataLocaleData);
|
|
36
|
-
ecma402_abstract_1.invariant(dataLocaleData !== undefined, "locale data for "
|
|
36
|
+
(0, ecma402_abstract_1.invariant)(dataLocaleData !== undefined, "locale data for ".concat(r.locale, " does not exist."));
|
|
37
37
|
var types = dataLocaleData.types;
|
|
38
|
-
ecma402_abstract_1.invariant(typeof types === 'object' && types != null, 'invalid types data');
|
|
38
|
+
(0, ecma402_abstract_1.invariant)(typeof types === 'object' && types != null, 'invalid types data');
|
|
39
39
|
var typeFields = types[type];
|
|
40
|
-
ecma402_abstract_1.invariant(typeof typeFields === 'object' && typeFields != null, 'invalid typeFields data');
|
|
40
|
+
(0, ecma402_abstract_1.invariant)(typeof typeFields === 'object' && typeFields != null, 'invalid typeFields data');
|
|
41
41
|
var styleFields = typeFields[style];
|
|
42
|
-
ecma402_abstract_1.invariant(typeof styleFields === 'object' && styleFields != null, 'invalid styleFields data');
|
|
42
|
+
(0, ecma402_abstract_1.invariant)(typeof styleFields === 'object' && styleFields != null, 'invalid styleFields data');
|
|
43
43
|
setSlot(this, 'fields', styleFields);
|
|
44
44
|
}
|
|
45
45
|
DisplayNames.supportedLocalesOf = function (locales, options) {
|
|
46
|
-
return ecma402_abstract_1.SupportedLocales(DisplayNames.availableLocales, ecma402_abstract_1.CanonicalizeLocaleList(locales), options);
|
|
46
|
+
return (0, ecma402_abstract_1.SupportedLocales)(DisplayNames.availableLocales, (0, ecma402_abstract_1.CanonicalizeLocaleList)(locales), options);
|
|
47
47
|
};
|
|
48
48
|
DisplayNames.__addLocaleData = function () {
|
|
49
49
|
var data = [];
|
|
@@ -66,13 +66,13 @@ var DisplayNames = /** @class */ (function () {
|
|
|
66
66
|
DisplayNames.prototype.of = function (code) {
|
|
67
67
|
checkReceiver(this, 'of');
|
|
68
68
|
var type = getSlot(this, 'type');
|
|
69
|
-
var codeAsString = ecma402_abstract_1.ToString(code);
|
|
69
|
+
var codeAsString = (0, ecma402_abstract_1.ToString)(code);
|
|
70
70
|
if (!isValidCodeForDisplayNames(type, codeAsString)) {
|
|
71
71
|
throw RangeError('invalid code for Intl.DisplayNames.prototype.of');
|
|
72
72
|
}
|
|
73
|
-
var _a = ecma402_abstract_1.getMultiInternalSlots(__INTERNAL_SLOT_MAP__, this, 'localeData', 'style', 'fallback'), localeData = _a.localeData, style = _a.style, fallback = _a.fallback;
|
|
73
|
+
var _a = (0, ecma402_abstract_1.getMultiInternalSlots)(__INTERNAL_SLOT_MAP__, this, 'localeData', 'style', 'fallback'), localeData = _a.localeData, style = _a.style, fallback = _a.fallback;
|
|
74
74
|
// Canonicalize the case.
|
|
75
|
-
var canonicalCode = CanonicalCodeForDisplayNames_1.CanonicalCodeForDisplayNames(type, codeAsString);
|
|
75
|
+
var canonicalCode = (0, CanonicalCodeForDisplayNames_1.CanonicalCodeForDisplayNames)(type, codeAsString);
|
|
76
76
|
// This is only used to store extracted language region.
|
|
77
77
|
var regionSubTag;
|
|
78
78
|
if (type === 'language') {
|
|
@@ -112,7 +112,7 @@ var DisplayNames = /** @class */ (function () {
|
|
|
112
112
|
};
|
|
113
113
|
DisplayNames.prototype.resolvedOptions = function () {
|
|
114
114
|
checkReceiver(this, 'resolvedOptions');
|
|
115
|
-
return tslib_1.__assign({}, ecma402_abstract_1.getMultiInternalSlots(__INTERNAL_SLOT_MAP__, this, 'locale', 'style', 'type', 'fallback'));
|
|
115
|
+
return (0, tslib_1.__assign)({}, (0, ecma402_abstract_1.getMultiInternalSlots)(__INTERNAL_SLOT_MAP__, this, 'locale', 'style', 'type', 'fallback'));
|
|
116
116
|
};
|
|
117
117
|
DisplayNames.getDefaultLocale = function () {
|
|
118
118
|
return DisplayNames.__defaultLocale;
|
|
@@ -142,7 +142,7 @@ function isValidCodeForDisplayNames(type, code) {
|
|
|
142
142
|
// unicode_script_subtag
|
|
143
143
|
return /^[a-z]{4}$/i.test(code);
|
|
144
144
|
case 'currency':
|
|
145
|
-
return ecma402_abstract_1.IsWellFormedCurrencyCode(code);
|
|
145
|
+
return (0, ecma402_abstract_1.IsWellFormedCurrencyCode)(code);
|
|
146
146
|
}
|
|
147
147
|
}
|
|
148
148
|
try {
|
|
@@ -167,13 +167,13 @@ catch (e) {
|
|
|
167
167
|
}
|
|
168
168
|
var __INTERNAL_SLOT_MAP__ = new WeakMap();
|
|
169
169
|
function getSlot(instance, key) {
|
|
170
|
-
return ecma402_abstract_1.getInternalSlot(__INTERNAL_SLOT_MAP__, instance, key);
|
|
170
|
+
return (0, ecma402_abstract_1.getInternalSlot)(__INTERNAL_SLOT_MAP__, instance, key);
|
|
171
171
|
}
|
|
172
172
|
function setSlot(instance, key, value) {
|
|
173
|
-
ecma402_abstract_1.setInternalSlot(__INTERNAL_SLOT_MAP__, instance, key, value);
|
|
173
|
+
(0, ecma402_abstract_1.setInternalSlot)(__INTERNAL_SLOT_MAP__, instance, key, value);
|
|
174
174
|
}
|
|
175
175
|
function checkReceiver(receiver, methodName) {
|
|
176
176
|
if (!(receiver instanceof DisplayNames)) {
|
|
177
|
-
throw TypeError("Method Intl.DisplayNames.prototype."
|
|
177
|
+
throw TypeError("Method Intl.DisplayNames.prototype.".concat(methodName, " called on incompatible receiver"));
|
|
178
178
|
}
|
|
179
179
|
}
|
|
@@ -21,7 +21,7 @@ export function CanonicalCodeForDisplayNames(type, code) {
|
|
|
21
21
|
if (!isUnicodeScriptSubtag(code)) {
|
|
22
22
|
throw RangeError('invalid script');
|
|
23
23
|
}
|
|
24
|
-
return ""
|
|
24
|
+
return "".concat(code[0].toUpperCase()).concat(code.slice(1).toLowerCase());
|
|
25
25
|
}
|
|
26
26
|
invariant(type === 'currency', 'invalid type');
|
|
27
27
|
if (!IsWellFormedCurrencyCode(code)) {
|
package/lib/index.js
CHANGED
|
@@ -28,9 +28,9 @@ var DisplayNames = /** @class */ (function () {
|
|
|
28
28
|
setSlot(this, 'locale', r.locale);
|
|
29
29
|
var dataLocale = r.dataLocale;
|
|
30
30
|
var dataLocaleData = localeData[dataLocale];
|
|
31
|
-
invariant(!!dataLocaleData, "Missing locale data for "
|
|
31
|
+
invariant(!!dataLocaleData, "Missing locale data for ".concat(dataLocale));
|
|
32
32
|
setSlot(this, 'localeData', dataLocaleData);
|
|
33
|
-
invariant(dataLocaleData !== undefined, "locale data for "
|
|
33
|
+
invariant(dataLocaleData !== undefined, "locale data for ".concat(r.locale, " does not exist."));
|
|
34
34
|
var types = dataLocaleData.types;
|
|
35
35
|
invariant(typeof types === 'object' && types != null, 'invalid types data');
|
|
36
36
|
var typeFields = types[type];
|
|
@@ -171,6 +171,6 @@ function setSlot(instance, key, value) {
|
|
|
171
171
|
}
|
|
172
172
|
function checkReceiver(receiver, methodName) {
|
|
173
173
|
if (!(receiver instanceof DisplayNames)) {
|
|
174
|
-
throw TypeError("Method Intl.DisplayNames.prototype."
|
|
174
|
+
throw TypeError("Method Intl.DisplayNames.prototype.".concat(methodName, " called on incompatible receiver"));
|
|
175
175
|
}
|
|
176
176
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@formatjs/intl-displaynames",
|
|
3
|
-
"version": "5.2.
|
|
3
|
+
"version": "5.2.6",
|
|
4
4
|
"description": "Polyfill for: https://tc39.es/proposal-intl-displaynames",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"i18n",
|
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
"url": "git+https://github.com/formatjs/formatjs.git"
|
|
22
22
|
},
|
|
23
23
|
"dependencies": {
|
|
24
|
-
"@formatjs/ecma402-abstract": "1.
|
|
24
|
+
"@formatjs/ecma402-abstract": "1.11.0",
|
|
25
25
|
"@formatjs/intl-localematcher": "0.2.21",
|
|
26
26
|
"tslib": "^2.1.0"
|
|
27
27
|
},
|
package/polyfill.iife.js
CHANGED
|
@@ -8,11 +8,8 @@
|
|
|
8
8
|
var __markAsModule = function(target) {
|
|
9
9
|
return __defProp(target, "__esModule", { value: true });
|
|
10
10
|
};
|
|
11
|
-
var __require = typeof require !== "undefined" ? require : function(x) {
|
|
12
|
-
throw new Error('Dynamic require of "' + x + '" is not supported');
|
|
13
|
-
};
|
|
14
11
|
var __commonJS = function(cb, mod) {
|
|
15
|
-
return function
|
|
12
|
+
return function __require() {
|
|
16
13
|
return mod || (0, cb[Object.keys(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
|
|
17
14
|
};
|
|
18
15
|
};
|
|
@@ -91,7 +88,7 @@
|
|
|
91
88
|
for (var _i = 0, requestedLocales_1 = requestedLocales; _i < requestedLocales_1.length; _i++) {
|
|
92
89
|
var locale = requestedLocales_1[_i];
|
|
93
90
|
var noExtensionLocale = locale.replace(utils_1.UNICODE_EXTENSION_SEQUENCE_REGEX, "");
|
|
94
|
-
var availableLocale = BestAvailableLocale_1.BestAvailableLocale(availableLocales, noExtensionLocale);
|
|
91
|
+
var availableLocale = (0, BestAvailableLocale_1.BestAvailableLocale)(availableLocales, noExtensionLocale);
|
|
95
92
|
if (availableLocale) {
|
|
96
93
|
result.locale = availableLocale;
|
|
97
94
|
if (locale !== noExtensionLocale) {
|
|
@@ -148,7 +145,7 @@
|
|
|
148
145
|
foundLocale = minimizedRequestedLocale;
|
|
149
146
|
break;
|
|
150
147
|
}
|
|
151
|
-
foundLocale = BestAvailableLocale_1.BestAvailableLocale(minimizedAvailableLocales, maximizedRequestedLocale);
|
|
148
|
+
foundLocale = (0, BestAvailableLocale_1.BestAvailableLocale)(minimizedAvailableLocales, maximizedRequestedLocale);
|
|
152
149
|
}
|
|
153
150
|
return {
|
|
154
151
|
locale: foundLocale && minimizedAvailableLocaleMap[foundLocale] || getDefaultLocale()
|
|
@@ -166,9 +163,9 @@
|
|
|
166
163
|
exports.UnicodeExtensionValue = void 0;
|
|
167
164
|
var utils_1 = require_utils();
|
|
168
165
|
function UnicodeExtensionValue(extension, key) {
|
|
169
|
-
utils_1.invariant(key.length === 2, "key must have 2 elements");
|
|
166
|
+
(0, utils_1.invariant)(key.length === 2, "key must have 2 elements");
|
|
170
167
|
var size = extension.length;
|
|
171
|
-
var searchValue = "-"
|
|
168
|
+
var searchValue = "-".concat(key, "-");
|
|
172
169
|
var pos = extension.indexOf(searchValue);
|
|
173
170
|
if (pos !== -1) {
|
|
174
171
|
var start = pos + 4;
|
|
@@ -195,7 +192,7 @@
|
|
|
195
192
|
}
|
|
196
193
|
return extension.slice(start, end);
|
|
197
194
|
}
|
|
198
|
-
searchValue = "-"
|
|
195
|
+
searchValue = "-".concat(key);
|
|
199
196
|
pos = extension.indexOf(searchValue);
|
|
200
197
|
if (pos !== -1 && pos + 3 === size) {
|
|
201
198
|
return "";
|
|
@@ -220,40 +217,40 @@
|
|
|
220
217
|
var matcher = options.localeMatcher;
|
|
221
218
|
var r;
|
|
222
219
|
if (matcher === "lookup") {
|
|
223
|
-
r = LookupMatcher_1.LookupMatcher(availableLocales, requestedLocales, getDefaultLocale);
|
|
220
|
+
r = (0, LookupMatcher_1.LookupMatcher)(availableLocales, requestedLocales, getDefaultLocale);
|
|
224
221
|
} else {
|
|
225
|
-
r = BestFitMatcher_1.BestFitMatcher(availableLocales, requestedLocales, getDefaultLocale);
|
|
222
|
+
r = (0, BestFitMatcher_1.BestFitMatcher)(availableLocales, requestedLocales, getDefaultLocale);
|
|
226
223
|
}
|
|
227
224
|
var foundLocale = r.locale;
|
|
228
225
|
var result = { locale: "", dataLocale: foundLocale };
|
|
229
226
|
var supportedExtension = "-u";
|
|
230
227
|
for (var _i = 0, relevantExtensionKeys_1 = relevantExtensionKeys; _i < relevantExtensionKeys_1.length; _i++) {
|
|
231
228
|
var key = relevantExtensionKeys_1[_i];
|
|
232
|
-
utils_1.invariant(foundLocale in localeData, "Missing locale data for "
|
|
229
|
+
(0, utils_1.invariant)(foundLocale in localeData, "Missing locale data for ".concat(foundLocale));
|
|
233
230
|
var foundLocaleData = localeData[foundLocale];
|
|
234
|
-
utils_1.invariant(typeof foundLocaleData === "object" && foundLocaleData !== null, "locale data "
|
|
231
|
+
(0, utils_1.invariant)(typeof foundLocaleData === "object" && foundLocaleData !== null, "locale data ".concat(key, " must be an object"));
|
|
235
232
|
var keyLocaleData = foundLocaleData[key];
|
|
236
|
-
utils_1.invariant(Array.isArray(keyLocaleData), "keyLocaleData for "
|
|
233
|
+
(0, utils_1.invariant)(Array.isArray(keyLocaleData), "keyLocaleData for ".concat(key, " must be an array"));
|
|
237
234
|
var value = keyLocaleData[0];
|
|
238
|
-
utils_1.invariant(typeof value === "string" || value === null, "value must be string or null but got "
|
|
235
|
+
(0, utils_1.invariant)(typeof value === "string" || value === null, "value must be string or null but got ".concat(typeof value, " in key ").concat(key));
|
|
239
236
|
var supportedExtensionAddition = "";
|
|
240
237
|
if (r.extension) {
|
|
241
|
-
var requestedValue = UnicodeExtensionValue_1.UnicodeExtensionValue(r.extension, key);
|
|
238
|
+
var requestedValue = (0, UnicodeExtensionValue_1.UnicodeExtensionValue)(r.extension, key);
|
|
242
239
|
if (requestedValue !== void 0) {
|
|
243
240
|
if (requestedValue !== "") {
|
|
244
241
|
if (~keyLocaleData.indexOf(requestedValue)) {
|
|
245
242
|
value = requestedValue;
|
|
246
|
-
supportedExtensionAddition = "-"
|
|
243
|
+
supportedExtensionAddition = "-".concat(key, "-").concat(value);
|
|
247
244
|
}
|
|
248
245
|
} else if (~requestedValue.indexOf("true")) {
|
|
249
246
|
value = "true";
|
|
250
|
-
supportedExtensionAddition = "-"
|
|
247
|
+
supportedExtensionAddition = "-".concat(key);
|
|
251
248
|
}
|
|
252
249
|
}
|
|
253
250
|
}
|
|
254
251
|
if (key in options) {
|
|
255
252
|
var optionsValue = options[key];
|
|
256
|
-
utils_1.invariant(typeof optionsValue === "string" || typeof optionsValue === "undefined" || optionsValue === null, "optionsValue must be String, Undefined or Null");
|
|
253
|
+
(0, utils_1.invariant)(typeof optionsValue === "string" || typeof optionsValue === "undefined" || optionsValue === null, "optionsValue must be String, Undefined or Null");
|
|
257
254
|
if (~keyLocaleData.indexOf(optionsValue)) {
|
|
258
255
|
if (optionsValue !== value) {
|
|
259
256
|
value = optionsValue;
|
|
@@ -295,7 +292,7 @@
|
|
|
295
292
|
for (var _i = 0, requestedLocales_1 = requestedLocales; _i < requestedLocales_1.length; _i++) {
|
|
296
293
|
var locale = requestedLocales_1[_i];
|
|
297
294
|
var noExtensionLocale = locale.replace(utils_1.UNICODE_EXTENSION_SEQUENCE_REGEX, "");
|
|
298
|
-
var availableLocale = BestAvailableLocale_1.BestAvailableLocale(availableLocales, noExtensionLocale);
|
|
295
|
+
var availableLocale = (0, BestAvailableLocale_1.BestAvailableLocale)(availableLocales, noExtensionLocale);
|
|
299
296
|
if (availableLocale) {
|
|
300
297
|
subset.push(availableLocale);
|
|
301
298
|
}
|
|
@@ -318,7 +315,7 @@
|
|
|
318
315
|
all.add(l);
|
|
319
316
|
return all;
|
|
320
317
|
}, new Set());
|
|
321
|
-
return ResolveLocale_1.ResolveLocale(locales, requestedLocales, {
|
|
318
|
+
return (0, ResolveLocale_1.ResolveLocale)(locales, requestedLocales, {
|
|
322
319
|
localeMatcher: (opts === null || opts === void 0 ? void 0 : opts.algorithm) || "best fit"
|
|
323
320
|
}, [], {}, function() {
|
|
324
321
|
return defaultLocale;
|
|
@@ -412,7 +409,7 @@
|
|
|
412
409
|
if (values !== void 0 && !values.filter(function(val) {
|
|
413
410
|
return val == value;
|
|
414
411
|
}).length) {
|
|
415
|
-
throw new RangeError(value
|
|
412
|
+
throw new RangeError("".concat(value, " is not within ").concat(values.join(", ")));
|
|
416
413
|
}
|
|
417
414
|
return value;
|
|
418
415
|
}
|
|
@@ -517,7 +514,7 @@
|
|
|
517
514
|
}
|
|
518
515
|
var slots = map.get(pl);
|
|
519
516
|
if (!slots) {
|
|
520
|
-
throw new TypeError(pl
|
|
517
|
+
throw new TypeError("".concat(pl, " InternalSlot has not been initialized"));
|
|
521
518
|
}
|
|
522
519
|
return fields.reduce(function(all, f) {
|
|
523
520
|
all[f] = slots[f];
|
|
@@ -537,8 +534,8 @@
|
|
|
537
534
|
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]/;
|
|
538
535
|
|
|
539
536
|
// bazel-out/darwin-fastbuild/bin/packages/ecma402-abstract/lib/NumberFormat/format_to_parts.js
|
|
540
|
-
var CARET_S_UNICODE_REGEX = new RegExp("^"
|
|
541
|
-
var S_DOLLAR_UNICODE_REGEX = new RegExp(S_UNICODE_REGEX.source
|
|
537
|
+
var CARET_S_UNICODE_REGEX = new RegExp("^".concat(S_UNICODE_REGEX.source));
|
|
538
|
+
var S_DOLLAR_UNICODE_REGEX = new RegExp("".concat(S_UNICODE_REGEX.source, "$"));
|
|
542
539
|
|
|
543
540
|
// bazel-out/darwin-fastbuild/bin/packages/ecma402-abstract/lib/NumberFormat/InitializeNumberFormat.js
|
|
544
541
|
var import_intl_localematcher = __toModule(require_intl_localematcher());
|
|
@@ -599,7 +596,7 @@
|
|
|
599
596
|
if (!isUnicodeScriptSubtag(code)) {
|
|
600
597
|
throw RangeError("invalid script");
|
|
601
598
|
}
|
|
602
|
-
return ""
|
|
599
|
+
return "".concat(code[0].toUpperCase()).concat(code.slice(1).toLowerCase());
|
|
603
600
|
}
|
|
604
601
|
invariant(type === "currency", "invalid type");
|
|
605
602
|
if (!IsWellFormedCurrencyCode(code)) {
|
|
@@ -635,9 +632,9 @@
|
|
|
635
632
|
setSlot(this, "locale", r.locale);
|
|
636
633
|
var dataLocale = r.dataLocale;
|
|
637
634
|
var dataLocaleData = localeData[dataLocale];
|
|
638
|
-
invariant(!!dataLocaleData, "Missing locale data for "
|
|
635
|
+
invariant(!!dataLocaleData, "Missing locale data for ".concat(dataLocale));
|
|
639
636
|
setSlot(this, "localeData", dataLocaleData);
|
|
640
|
-
invariant(dataLocaleData !== void 0, "locale data for "
|
|
637
|
+
invariant(dataLocaleData !== void 0, "locale data for ".concat(r.locale, " does not exist."));
|
|
641
638
|
var types = dataLocaleData.types;
|
|
642
639
|
invariant(typeof types === "object" && types != null, "invalid types data");
|
|
643
640
|
var typeFields = types[type];
|
|
@@ -751,7 +748,7 @@
|
|
|
751
748
|
}
|
|
752
749
|
function checkReceiver(receiver, methodName) {
|
|
753
750
|
if (!(receiver instanceof DisplayNames)) {
|
|
754
|
-
throw TypeError("Method Intl.DisplayNames.prototype."
|
|
751
|
+
throw TypeError("Method Intl.DisplayNames.prototype.".concat(methodName, " called on incompatible receiver"));
|
|
755
752
|
}
|
|
756
753
|
}
|
|
757
754
|
|
package/polyfill.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
var _1 = require("./");
|
|
4
4
|
var should_polyfill_1 = require("./should-polyfill");
|
|
5
|
-
if (should_polyfill_1.shouldPolyfill()) {
|
|
5
|
+
if ((0, should_polyfill_1.shouldPolyfill)()) {
|
|
6
6
|
Object.defineProperty(Intl, 'DisplayNames', {
|
|
7
7
|
value: _1.DisplayNames,
|
|
8
8
|
enumerable: false,
|