@formatjs/intl-listformat 6.2.3 → 6.3.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/index.d.ts.map +1 -1
- package/index.js +2 -1
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +2 -1
- package/lib/should-polyfill.d.ts +1 -1
- package/lib/should-polyfill.d.ts.map +1 -1
- package/lib/should-polyfill.js +10 -2
- package/package.json +3 -2
- package/polyfill.iife.js +350 -197
- package/should-polyfill.d.ts +1 -1
- package/should-polyfill.d.ts.map +1 -1
- package/should-polyfill.js +10 -2
package/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../packages/intl-listformat/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,qBAAqB,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../packages/intl-listformat/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,qBAAqB,EAIrB,qBAAqB,EAKrB,WAAW,EAGZ,MAAM,4BAA4B,CAAA;AAGnC,MAAM,WAAW,qBAAqB;IACpC;;;;;OAKG;IACH,aAAa,CAAC,EAAE,UAAU,GAAG,QAAQ,CAAA;IACrC;;;;;;OAMG;IACH,IAAI,CAAC,EAAE,aAAa,GAAG,aAAa,GAAG,MAAM,CAAA;IAC7C;;;;;;;OAOG;IACH,KAAK,CAAC,EAAE,MAAM,GAAG,OAAO,GAAG,QAAQ,CAAA;CACpC;AAED,MAAM,WAAW,6BAA6B;IAC5C;;;;OAIG;IACH,MAAM,EAAE,MAAM,CAAA;IACd;;;;;;OAMG;IACH,IAAI,EAAE,aAAa,GAAG,aAAa,GAAG,MAAM,CAAA;IAC5C;;;;;;;OAOG;IACH,KAAK,EAAE,MAAM,GAAG,OAAO,GAAG,QAAQ,CAAA;CACnC;AAED,oBAAY,IAAI,CAAC,CAAC,GAAG,MAAM,IAAI,WAAW,GAAG,WAAW,GAAG,WAAW,CAAC,CAAC,CAAC,CAAA;AAEzE,MAAM,WAAW,WAAW,CAAC,CAAC,GAAG,MAAM;IACrC,IAAI,EAAE,SAAS,CAAA;IACf,KAAK,EAAE,CAAC,CAAA;CACT;AA6GD,MAAM,CAAC,OAAO,OAAO,UAAU;gBACjB,OAAO,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,EAAE,OAAO,CAAC,EAAE,qBAAqB;IAiFxE,MAAM,CAAC,QAAQ,EAAE,MAAM,EAAE,GAAG,MAAM;IAgBlC,aAAa,CAAC,QAAQ,EAAE,MAAM,EAAE,GAAG,IAAI,EAAE;IAiBzC,eAAe,IAAI,6BAA6B;WASlC,kBAAkB,CAC9B,OAAO,EAAE,MAAM,GAAG,MAAM,EAAE,EAC1B,OAAO,CAAC,EAAE,IAAI,CAAC,qBAAqB,EAAE,eAAe,CAAC;WAU1C,eAAe,CAAC,GAAG,IAAI,EAAE,qBAAqB,EAAE;IAa9D,MAAM,CAAC,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,qBAAqB,GAAG,SAAS,CAAC,CAAK;IACzE,OAAO,CAAC,MAAM,CAAC,gBAAgB,CAAoB;IACnD,OAAO,CAAC,MAAM,CAAC,eAAe,CAAK;IACnC,OAAO,CAAC,MAAM,CAAC,gBAAgB;IAG/B,OAAO,CAAC,MAAM,CAAC,qBAAqB,CAAK;IACzC,OAAc,UAAU,UAAO;IAC/B,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,qBAAqB,CAG1C;CACJ"}
|
package/index.js
CHANGED
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
var tslib_1 = require("tslib");
|
|
4
4
|
var ecma402_abstract_1 = require("@formatjs/ecma402-abstract");
|
|
5
|
+
var intl_localematcher_1 = require("@formatjs/intl-localematcher");
|
|
5
6
|
function validateInstance(instance, method) {
|
|
6
7
|
if (!(instance instanceof ListFormat)) {
|
|
7
8
|
throw new TypeError("Method Intl.ListFormat.prototype." + method + " called on incompatible receiver " + String(instance));
|
|
@@ -99,7 +100,7 @@ var ListFormat = /** @class */ (function () {
|
|
|
99
100
|
var matcher = ecma402_abstract_1.GetOption(opts, 'localeMatcher', 'string', ['best fit', 'lookup'], 'best fit');
|
|
100
101
|
opt.localeMatcher = matcher;
|
|
101
102
|
var localeData = ListFormat.localeData;
|
|
102
|
-
var r =
|
|
103
|
+
var r = intl_localematcher_1.ResolveLocale(ListFormat.availableLocales, requestedLocales, opt, ListFormat.relevantExtensionKeys, localeData, ListFormat.getDefaultLocale);
|
|
103
104
|
ecma402_abstract_1.setInternalSlot(ListFormat.__INTERNAL_SLOT_MAP__, this, 'locale', r.locale);
|
|
104
105
|
var type = ecma402_abstract_1.GetOption(opts, 'type', 'string', ['conjunction', 'disjunction', 'unit'], 'conjunction');
|
|
105
106
|
ecma402_abstract_1.setInternalSlot(ListFormat.__INTERNAL_SLOT_MAP__, this, 'type', type);
|
package/lib/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../packages/intl-listformat/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,qBAAqB,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../packages/intl-listformat/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,qBAAqB,EAIrB,qBAAqB,EAKrB,WAAW,EAGZ,MAAM,4BAA4B,CAAA;AAGnC,MAAM,WAAW,qBAAqB;IACpC;;;;;OAKG;IACH,aAAa,CAAC,EAAE,UAAU,GAAG,QAAQ,CAAA;IACrC;;;;;;OAMG;IACH,IAAI,CAAC,EAAE,aAAa,GAAG,aAAa,GAAG,MAAM,CAAA;IAC7C;;;;;;;OAOG;IACH,KAAK,CAAC,EAAE,MAAM,GAAG,OAAO,GAAG,QAAQ,CAAA;CACpC;AAED,MAAM,WAAW,6BAA6B;IAC5C;;;;OAIG;IACH,MAAM,EAAE,MAAM,CAAA;IACd;;;;;;OAMG;IACH,IAAI,EAAE,aAAa,GAAG,aAAa,GAAG,MAAM,CAAA;IAC5C;;;;;;;OAOG;IACH,KAAK,EAAE,MAAM,GAAG,OAAO,GAAG,QAAQ,CAAA;CACnC;AAED,oBAAY,IAAI,CAAC,CAAC,GAAG,MAAM,IAAI,WAAW,GAAG,WAAW,GAAG,WAAW,CAAC,CAAC,CAAC,CAAA;AAEzE,MAAM,WAAW,WAAW,CAAC,CAAC,GAAG,MAAM;IACrC,IAAI,EAAE,SAAS,CAAA;IACf,KAAK,EAAE,CAAC,CAAA;CACT;AA6GD,MAAM,CAAC,OAAO,OAAO,UAAU;gBACjB,OAAO,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,EAAE,OAAO,CAAC,EAAE,qBAAqB;IAiFxE,MAAM,CAAC,QAAQ,EAAE,MAAM,EAAE,GAAG,MAAM;IAgBlC,aAAa,CAAC,QAAQ,EAAE,MAAM,EAAE,GAAG,IAAI,EAAE;IAiBzC,eAAe,IAAI,6BAA6B;WASlC,kBAAkB,CAC9B,OAAO,EAAE,MAAM,GAAG,MAAM,EAAE,EAC1B,OAAO,CAAC,EAAE,IAAI,CAAC,qBAAqB,EAAE,eAAe,CAAC;WAU1C,eAAe,CAAC,GAAG,IAAI,EAAE,qBAAqB,EAAE;IAa9D,MAAM,CAAC,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,qBAAqB,GAAG,SAAS,CAAC,CAAK;IACzE,OAAO,CAAC,MAAM,CAAC,gBAAgB,CAAoB;IACnD,OAAO,CAAC,MAAM,CAAC,eAAe,CAAK;IACnC,OAAO,CAAC,MAAM,CAAC,gBAAgB;IAG/B,OAAO,CAAC,MAAM,CAAC,qBAAqB,CAAK;IACzC,OAAc,UAAU,UAAO;IAC/B,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,qBAAqB,CAG1C;CACJ"}
|
package/lib/index.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { __assign } from "tslib";
|
|
2
|
-
import { GetOption, setInternalSlot, SupportedLocales,
|
|
2
|
+
import { GetOption, setInternalSlot, SupportedLocales, getInternalSlot, PartitionPattern, invariant, isLiteralPart, GetOptionsObject, CanonicalizeLocaleList, } from '@formatjs/ecma402-abstract';
|
|
3
|
+
import { ResolveLocale } from '@formatjs/intl-localematcher';
|
|
3
4
|
function validateInstance(instance, method) {
|
|
4
5
|
if (!(instance instanceof ListFormat)) {
|
|
5
6
|
throw new TypeError("Method Intl.ListFormat.prototype." + method + " called on incompatible receiver " + String(instance));
|
package/lib/should-polyfill.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare function shouldPolyfill(): boolean;
|
|
1
|
+
export declare function shouldPolyfill(locale?: string | string[]): boolean;
|
|
2
2
|
//# sourceMappingURL=should-polyfill.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"should-polyfill.d.ts","sourceRoot":"","sources":["../../../../../../packages/intl-listformat/should-polyfill.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"should-polyfill.d.ts","sourceRoot":"","sources":["../../../../../../packages/intl-listformat/should-polyfill.ts"],"names":[],"mappings":"AAWA,wBAAgB,cAAc,CAAC,MAAM,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,WAExD"}
|
package/lib/should-polyfill.js
CHANGED
|
@@ -1,3 +1,11 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
function supportedLocalesOf(locale) {
|
|
2
|
+
if (!locale) {
|
|
3
|
+
return true;
|
|
4
|
+
}
|
|
5
|
+
var locales = Array.isArray(locale) ? locale : [locale];
|
|
6
|
+
return (Intl.ListFormat.supportedLocalesOf(locales).length ===
|
|
7
|
+
locales.length);
|
|
8
|
+
}
|
|
9
|
+
export function shouldPolyfill(locale) {
|
|
10
|
+
return !('ListFormat' in Intl) || !supportedLocalesOf(locale);
|
|
3
11
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@formatjs/intl-listformat",
|
|
3
|
-
"version": "6.
|
|
3
|
+
"version": "6.3.0",
|
|
4
4
|
"description": "Formats JS list in a i18n-safe way",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"intl",
|
|
@@ -19,7 +19,8 @@
|
|
|
19
19
|
"url": "git@github.com:formatjs/formatjs.git"
|
|
20
20
|
},
|
|
21
21
|
"dependencies": {
|
|
22
|
-
"@formatjs/ecma402-abstract": "1.9.
|
|
22
|
+
"@formatjs/ecma402-abstract": "1.9.5",
|
|
23
|
+
"@formatjs/intl-localematcher": "0.2.18",
|
|
23
24
|
"tslib": "^2.1.0"
|
|
24
25
|
},
|
|
25
26
|
"main": "index.js",
|
package/polyfill.iife.js
CHANGED
|
@@ -1,4 +1,338 @@
|
|
|
1
1
|
(function() {
|
|
2
|
+
var __create = Object.create;
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
+
var __markAsModule = function(target) {
|
|
9
|
+
return __defProp(target, "__esModule", {value: true});
|
|
10
|
+
};
|
|
11
|
+
var __commonJS = function(cb, mod) {
|
|
12
|
+
return function __require() {
|
|
13
|
+
return mod || (0, cb[Object.keys(cb)[0]])((mod = {exports: {}}).exports, mod), mod.exports;
|
|
14
|
+
};
|
|
15
|
+
};
|
|
16
|
+
var __reExport = function(target, module, desc) {
|
|
17
|
+
if (module && typeof module === "object" || typeof module === "function")
|
|
18
|
+
for (var keys = __getOwnPropNames(module), i = 0, n = keys.length, key; i < n; i++) {
|
|
19
|
+
key = keys[i];
|
|
20
|
+
if (!__hasOwnProp.call(target, key) && key !== "default")
|
|
21
|
+
__defProp(target, key, {get: function(k) {
|
|
22
|
+
return module[k];
|
|
23
|
+
}.bind(null, key), enumerable: !(desc = __getOwnPropDesc(module, key)) || desc.enumerable});
|
|
24
|
+
}
|
|
25
|
+
return target;
|
|
26
|
+
};
|
|
27
|
+
var __toModule = function(module) {
|
|
28
|
+
return __reExport(__markAsModule(__defProp(module != null ? __create(__getProtoOf(module)) : {}, "default", module && module.__esModule && "default" in module ? {get: function() {
|
|
29
|
+
return module.default;
|
|
30
|
+
}, enumerable: true} : {value: module, enumerable: true})), module);
|
|
31
|
+
};
|
|
32
|
+
|
|
33
|
+
// bazel-out/darwin-fastbuild/bin/packages/intl-localematcher/abstract/utils.js
|
|
34
|
+
var require_utils = __commonJS({
|
|
35
|
+
"bazel-out/darwin-fastbuild/bin/packages/intl-localematcher/abstract/utils.js": function(exports) {
|
|
36
|
+
"use strict";
|
|
37
|
+
Object.defineProperty(exports, "__esModule", {value: true});
|
|
38
|
+
exports.invariant = exports.UNICODE_EXTENSION_SEQUENCE_REGEX = void 0;
|
|
39
|
+
exports.UNICODE_EXTENSION_SEQUENCE_REGEX = /-u(?:-[0-9a-z]{2,8})+/gi;
|
|
40
|
+
function invariant2(condition, message, Err) {
|
|
41
|
+
if (Err === void 0) {
|
|
42
|
+
Err = Error;
|
|
43
|
+
}
|
|
44
|
+
if (!condition) {
|
|
45
|
+
throw new Err(message);
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
exports.invariant = invariant2;
|
|
49
|
+
}
|
|
50
|
+
});
|
|
51
|
+
|
|
52
|
+
// bazel-out/darwin-fastbuild/bin/packages/intl-localematcher/abstract/BestAvailableLocale.js
|
|
53
|
+
var require_BestAvailableLocale = __commonJS({
|
|
54
|
+
"bazel-out/darwin-fastbuild/bin/packages/intl-localematcher/abstract/BestAvailableLocale.js": function(exports) {
|
|
55
|
+
"use strict";
|
|
56
|
+
Object.defineProperty(exports, "__esModule", {value: true});
|
|
57
|
+
exports.BestAvailableLocale = void 0;
|
|
58
|
+
function BestAvailableLocale(availableLocales, locale) {
|
|
59
|
+
var candidate = locale;
|
|
60
|
+
while (true) {
|
|
61
|
+
if (availableLocales.has(candidate)) {
|
|
62
|
+
return candidate;
|
|
63
|
+
}
|
|
64
|
+
var pos = candidate.lastIndexOf("-");
|
|
65
|
+
if (!~pos) {
|
|
66
|
+
return void 0;
|
|
67
|
+
}
|
|
68
|
+
if (pos >= 2 && candidate[pos - 2] === "-") {
|
|
69
|
+
pos -= 2;
|
|
70
|
+
}
|
|
71
|
+
candidate = candidate.slice(0, pos);
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
exports.BestAvailableLocale = BestAvailableLocale;
|
|
75
|
+
}
|
|
76
|
+
});
|
|
77
|
+
|
|
78
|
+
// bazel-out/darwin-fastbuild/bin/packages/intl-localematcher/abstract/LookupMatcher.js
|
|
79
|
+
var require_LookupMatcher = __commonJS({
|
|
80
|
+
"bazel-out/darwin-fastbuild/bin/packages/intl-localematcher/abstract/LookupMatcher.js": function(exports) {
|
|
81
|
+
"use strict";
|
|
82
|
+
Object.defineProperty(exports, "__esModule", {value: true});
|
|
83
|
+
exports.LookupMatcher = void 0;
|
|
84
|
+
var utils_1 = require_utils();
|
|
85
|
+
var BestAvailableLocale_1 = require_BestAvailableLocale();
|
|
86
|
+
function LookupMatcher(availableLocales, requestedLocales, getDefaultLocale) {
|
|
87
|
+
var result = {locale: ""};
|
|
88
|
+
for (var _i = 0, requestedLocales_1 = requestedLocales; _i < requestedLocales_1.length; _i++) {
|
|
89
|
+
var locale = requestedLocales_1[_i];
|
|
90
|
+
var noExtensionLocale = locale.replace(utils_1.UNICODE_EXTENSION_SEQUENCE_REGEX, "");
|
|
91
|
+
var availableLocale = BestAvailableLocale_1.BestAvailableLocale(availableLocales, noExtensionLocale);
|
|
92
|
+
if (availableLocale) {
|
|
93
|
+
result.locale = availableLocale;
|
|
94
|
+
if (locale !== noExtensionLocale) {
|
|
95
|
+
result.extension = locale.slice(noExtensionLocale.length + 1, locale.length);
|
|
96
|
+
}
|
|
97
|
+
return result;
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
result.locale = getDefaultLocale();
|
|
101
|
+
return result;
|
|
102
|
+
}
|
|
103
|
+
exports.LookupMatcher = LookupMatcher;
|
|
104
|
+
}
|
|
105
|
+
});
|
|
106
|
+
|
|
107
|
+
// bazel-out/darwin-fastbuild/bin/packages/intl-localematcher/abstract/BestFitMatcher.js
|
|
108
|
+
var require_BestFitMatcher = __commonJS({
|
|
109
|
+
"bazel-out/darwin-fastbuild/bin/packages/intl-localematcher/abstract/BestFitMatcher.js": function(exports) {
|
|
110
|
+
"use strict";
|
|
111
|
+
Object.defineProperty(exports, "__esModule", {value: true});
|
|
112
|
+
exports.BestFitMatcher = void 0;
|
|
113
|
+
var BestAvailableLocale_1 = require_BestAvailableLocale();
|
|
114
|
+
var utils_1 = require_utils();
|
|
115
|
+
function BestFitMatcher(availableLocales, requestedLocales, getDefaultLocale) {
|
|
116
|
+
var minimizedAvailableLocaleMap = Array.from(availableLocales).reduce(function(all, l2) {
|
|
117
|
+
all[l2] = l2;
|
|
118
|
+
return all;
|
|
119
|
+
}, {});
|
|
120
|
+
var minimizedAvailableLocales = new Set();
|
|
121
|
+
availableLocales.forEach(function(locale2) {
|
|
122
|
+
var minimizedLocale = new Intl.Locale(locale2).minimize().toString();
|
|
123
|
+
minimizedAvailableLocaleMap[minimizedLocale] = locale2;
|
|
124
|
+
minimizedAvailableLocales.add(minimizedLocale);
|
|
125
|
+
});
|
|
126
|
+
var foundLocale;
|
|
127
|
+
for (var _i = 0, requestedLocales_1 = requestedLocales; _i < requestedLocales_1.length; _i++) {
|
|
128
|
+
var l = requestedLocales_1[_i];
|
|
129
|
+
if (foundLocale) {
|
|
130
|
+
break;
|
|
131
|
+
}
|
|
132
|
+
var noExtensionLocale = l.replace(utils_1.UNICODE_EXTENSION_SEQUENCE_REGEX, "");
|
|
133
|
+
if (availableLocales.has(noExtensionLocale)) {
|
|
134
|
+
foundLocale = noExtensionLocale;
|
|
135
|
+
break;
|
|
136
|
+
}
|
|
137
|
+
if (minimizedAvailableLocales.has(noExtensionLocale)) {
|
|
138
|
+
foundLocale = noExtensionLocale;
|
|
139
|
+
break;
|
|
140
|
+
}
|
|
141
|
+
var locale = new Intl.Locale(noExtensionLocale);
|
|
142
|
+
var maximizedRequestedLocale = locale.maximize().toString();
|
|
143
|
+
var minimizedRequestedLocale = locale.minimize().toString();
|
|
144
|
+
if (minimizedAvailableLocales.has(minimizedRequestedLocale)) {
|
|
145
|
+
foundLocale = minimizedRequestedLocale;
|
|
146
|
+
break;
|
|
147
|
+
}
|
|
148
|
+
foundLocale = BestAvailableLocale_1.BestAvailableLocale(minimizedAvailableLocales, maximizedRequestedLocale);
|
|
149
|
+
}
|
|
150
|
+
return {
|
|
151
|
+
locale: foundLocale && minimizedAvailableLocaleMap[foundLocale] || getDefaultLocale()
|
|
152
|
+
};
|
|
153
|
+
}
|
|
154
|
+
exports.BestFitMatcher = BestFitMatcher;
|
|
155
|
+
}
|
|
156
|
+
});
|
|
157
|
+
|
|
158
|
+
// bazel-out/darwin-fastbuild/bin/packages/intl-localematcher/abstract/UnicodeExtensionValue.js
|
|
159
|
+
var require_UnicodeExtensionValue = __commonJS({
|
|
160
|
+
"bazel-out/darwin-fastbuild/bin/packages/intl-localematcher/abstract/UnicodeExtensionValue.js": function(exports) {
|
|
161
|
+
"use strict";
|
|
162
|
+
Object.defineProperty(exports, "__esModule", {value: true});
|
|
163
|
+
exports.UnicodeExtensionValue = void 0;
|
|
164
|
+
var utils_1 = require_utils();
|
|
165
|
+
function UnicodeExtensionValue(extension, key) {
|
|
166
|
+
utils_1.invariant(key.length === 2, "key must have 2 elements");
|
|
167
|
+
var size = extension.length;
|
|
168
|
+
var searchValue = "-" + key + "-";
|
|
169
|
+
var pos = extension.indexOf(searchValue);
|
|
170
|
+
if (pos !== -1) {
|
|
171
|
+
var start = pos + 4;
|
|
172
|
+
var end = start;
|
|
173
|
+
var k = start;
|
|
174
|
+
var done = false;
|
|
175
|
+
while (!done) {
|
|
176
|
+
var e = extension.indexOf("-", k);
|
|
177
|
+
var len = void 0;
|
|
178
|
+
if (e === -1) {
|
|
179
|
+
len = size - k;
|
|
180
|
+
} else {
|
|
181
|
+
len = e - k;
|
|
182
|
+
}
|
|
183
|
+
if (len === 2) {
|
|
184
|
+
done = true;
|
|
185
|
+
} else if (e === -1) {
|
|
186
|
+
end = size;
|
|
187
|
+
done = true;
|
|
188
|
+
} else {
|
|
189
|
+
end = e;
|
|
190
|
+
k = e + 1;
|
|
191
|
+
}
|
|
192
|
+
}
|
|
193
|
+
return extension.slice(start, end);
|
|
194
|
+
}
|
|
195
|
+
searchValue = "-" + key;
|
|
196
|
+
pos = extension.indexOf(searchValue);
|
|
197
|
+
if (pos !== -1 && pos + 3 === size) {
|
|
198
|
+
return "";
|
|
199
|
+
}
|
|
200
|
+
return void 0;
|
|
201
|
+
}
|
|
202
|
+
exports.UnicodeExtensionValue = UnicodeExtensionValue;
|
|
203
|
+
}
|
|
204
|
+
});
|
|
205
|
+
|
|
206
|
+
// bazel-out/darwin-fastbuild/bin/packages/intl-localematcher/abstract/ResolveLocale.js
|
|
207
|
+
var require_ResolveLocale = __commonJS({
|
|
208
|
+
"bazel-out/darwin-fastbuild/bin/packages/intl-localematcher/abstract/ResolveLocale.js": function(exports) {
|
|
209
|
+
"use strict";
|
|
210
|
+
Object.defineProperty(exports, "__esModule", {value: true});
|
|
211
|
+
exports.ResolveLocale = void 0;
|
|
212
|
+
var LookupMatcher_1 = require_LookupMatcher();
|
|
213
|
+
var BestFitMatcher_1 = require_BestFitMatcher();
|
|
214
|
+
var utils_1 = require_utils();
|
|
215
|
+
var UnicodeExtensionValue_1 = require_UnicodeExtensionValue();
|
|
216
|
+
function ResolveLocale3(availableLocales, requestedLocales, options, relevantExtensionKeys, localeData, getDefaultLocale) {
|
|
217
|
+
var matcher = options.localeMatcher;
|
|
218
|
+
var r;
|
|
219
|
+
if (matcher === "lookup") {
|
|
220
|
+
r = LookupMatcher_1.LookupMatcher(availableLocales, requestedLocales, getDefaultLocale);
|
|
221
|
+
} else {
|
|
222
|
+
r = BestFitMatcher_1.BestFitMatcher(availableLocales, requestedLocales, getDefaultLocale);
|
|
223
|
+
}
|
|
224
|
+
var foundLocale = r.locale;
|
|
225
|
+
var result = {locale: "", dataLocale: foundLocale};
|
|
226
|
+
var supportedExtension = "-u";
|
|
227
|
+
for (var _i = 0, relevantExtensionKeys_1 = relevantExtensionKeys; _i < relevantExtensionKeys_1.length; _i++) {
|
|
228
|
+
var key = relevantExtensionKeys_1[_i];
|
|
229
|
+
utils_1.invariant(foundLocale in localeData, "Missing locale data for " + foundLocale);
|
|
230
|
+
var foundLocaleData = localeData[foundLocale];
|
|
231
|
+
utils_1.invariant(typeof foundLocaleData === "object" && foundLocaleData !== null, "locale data " + key + " must be an object");
|
|
232
|
+
var keyLocaleData = foundLocaleData[key];
|
|
233
|
+
utils_1.invariant(Array.isArray(keyLocaleData), "keyLocaleData for " + key + " must be an array");
|
|
234
|
+
var value = keyLocaleData[0];
|
|
235
|
+
utils_1.invariant(typeof value === "string" || value === null, "value must be string or null but got " + typeof value + " in key " + key);
|
|
236
|
+
var supportedExtensionAddition = "";
|
|
237
|
+
if (r.extension) {
|
|
238
|
+
var requestedValue = UnicodeExtensionValue_1.UnicodeExtensionValue(r.extension, key);
|
|
239
|
+
if (requestedValue !== void 0) {
|
|
240
|
+
if (requestedValue !== "") {
|
|
241
|
+
if (~keyLocaleData.indexOf(requestedValue)) {
|
|
242
|
+
value = requestedValue;
|
|
243
|
+
supportedExtensionAddition = "-" + key + "-" + value;
|
|
244
|
+
}
|
|
245
|
+
} else if (~requestedValue.indexOf("true")) {
|
|
246
|
+
value = "true";
|
|
247
|
+
supportedExtensionAddition = "-" + key;
|
|
248
|
+
}
|
|
249
|
+
}
|
|
250
|
+
}
|
|
251
|
+
if (key in options) {
|
|
252
|
+
var optionsValue = options[key];
|
|
253
|
+
utils_1.invariant(typeof optionsValue === "string" || typeof optionsValue === "undefined" || optionsValue === null, "optionsValue must be String, Undefined or Null");
|
|
254
|
+
if (~keyLocaleData.indexOf(optionsValue)) {
|
|
255
|
+
if (optionsValue !== value) {
|
|
256
|
+
value = optionsValue;
|
|
257
|
+
supportedExtensionAddition = "";
|
|
258
|
+
}
|
|
259
|
+
}
|
|
260
|
+
}
|
|
261
|
+
result[key] = value;
|
|
262
|
+
supportedExtension += supportedExtensionAddition;
|
|
263
|
+
}
|
|
264
|
+
if (supportedExtension.length > 2) {
|
|
265
|
+
var privateIndex = foundLocale.indexOf("-x-");
|
|
266
|
+
if (privateIndex === -1) {
|
|
267
|
+
foundLocale = foundLocale + supportedExtension;
|
|
268
|
+
} else {
|
|
269
|
+
var preExtension = foundLocale.slice(0, privateIndex);
|
|
270
|
+
var postExtension = foundLocale.slice(privateIndex, foundLocale.length);
|
|
271
|
+
foundLocale = preExtension + supportedExtension + postExtension;
|
|
272
|
+
}
|
|
273
|
+
foundLocale = Intl.getCanonicalLocales(foundLocale)[0];
|
|
274
|
+
}
|
|
275
|
+
result.locale = foundLocale;
|
|
276
|
+
return result;
|
|
277
|
+
}
|
|
278
|
+
exports.ResolveLocale = ResolveLocale3;
|
|
279
|
+
}
|
|
280
|
+
});
|
|
281
|
+
|
|
282
|
+
// bazel-out/darwin-fastbuild/bin/packages/intl-localematcher/abstract/LookupSupportedLocales.js
|
|
283
|
+
var require_LookupSupportedLocales = __commonJS({
|
|
284
|
+
"bazel-out/darwin-fastbuild/bin/packages/intl-localematcher/abstract/LookupSupportedLocales.js": function(exports) {
|
|
285
|
+
"use strict";
|
|
286
|
+
Object.defineProperty(exports, "__esModule", {value: true});
|
|
287
|
+
exports.LookupSupportedLocales = void 0;
|
|
288
|
+
var utils_1 = require_utils();
|
|
289
|
+
var BestAvailableLocale_1 = require_BestAvailableLocale();
|
|
290
|
+
function LookupSupportedLocales2(availableLocales, requestedLocales) {
|
|
291
|
+
var subset = [];
|
|
292
|
+
for (var _i = 0, requestedLocales_1 = requestedLocales; _i < requestedLocales_1.length; _i++) {
|
|
293
|
+
var locale = requestedLocales_1[_i];
|
|
294
|
+
var noExtensionLocale = locale.replace(utils_1.UNICODE_EXTENSION_SEQUENCE_REGEX, "");
|
|
295
|
+
var availableLocale = BestAvailableLocale_1.BestAvailableLocale(availableLocales, noExtensionLocale);
|
|
296
|
+
if (availableLocale) {
|
|
297
|
+
subset.push(availableLocale);
|
|
298
|
+
}
|
|
299
|
+
}
|
|
300
|
+
return subset;
|
|
301
|
+
}
|
|
302
|
+
exports.LookupSupportedLocales = LookupSupportedLocales2;
|
|
303
|
+
}
|
|
304
|
+
});
|
|
305
|
+
|
|
306
|
+
// bazel-out/darwin-fastbuild/bin/packages/intl-localematcher/index.js
|
|
307
|
+
var require_intl_localematcher = __commonJS({
|
|
308
|
+
"bazel-out/darwin-fastbuild/bin/packages/intl-localematcher/index.js": function(exports) {
|
|
309
|
+
"use strict";
|
|
310
|
+
Object.defineProperty(exports, "__esModule", {value: true});
|
|
311
|
+
exports.ResolveLocale = exports.LookupSupportedLocales = exports.match = void 0;
|
|
312
|
+
var ResolveLocale_1 = require_ResolveLocale();
|
|
313
|
+
function match(requestedLocales, availableLocales, defaultLocale, opts) {
|
|
314
|
+
var locales = availableLocales.reduce(function(all, l) {
|
|
315
|
+
all.add(l);
|
|
316
|
+
return all;
|
|
317
|
+
}, new Set());
|
|
318
|
+
return ResolveLocale_1.ResolveLocale(locales, requestedLocales, {
|
|
319
|
+
localeMatcher: (opts === null || opts === void 0 ? void 0 : opts.algorithm) || "best fit"
|
|
320
|
+
}, [], {}, function() {
|
|
321
|
+
return defaultLocale;
|
|
322
|
+
}).locale;
|
|
323
|
+
}
|
|
324
|
+
exports.match = match;
|
|
325
|
+
var LookupSupportedLocales_1 = require_LookupSupportedLocales();
|
|
326
|
+
Object.defineProperty(exports, "LookupSupportedLocales", {enumerable: true, get: function() {
|
|
327
|
+
return LookupSupportedLocales_1.LookupSupportedLocales;
|
|
328
|
+
}});
|
|
329
|
+
var ResolveLocale_2 = require_ResolveLocale();
|
|
330
|
+
Object.defineProperty(exports, "ResolveLocale", {enumerable: true, get: function() {
|
|
331
|
+
return ResolveLocale_2.ResolveLocale;
|
|
332
|
+
}});
|
|
333
|
+
}
|
|
334
|
+
});
|
|
335
|
+
|
|
2
336
|
// node_modules/tslib/tslib.es6.js
|
|
3
337
|
var extendStatics = function(d, b) {
|
|
4
338
|
extendStatics = Object.setPrototypeOf || {__proto__: []} instanceof Array && function(d2, b2) {
|
|
@@ -172,7 +506,6 @@
|
|
|
172
506
|
function isLiteralPart(patternPart) {
|
|
173
507
|
return patternPart.type === "literal";
|
|
174
508
|
}
|
|
175
|
-
var UNICODE_EXTENSION_SEQUENCE_REGEX = /-u(?:-[0-9a-z]{2,8})+/gi;
|
|
176
509
|
function invariant(condition, message, Err) {
|
|
177
510
|
if (Err === void 0) {
|
|
178
511
|
Err = Error;
|
|
@@ -189,183 +522,8 @@
|
|
|
189
522
|
var CARET_S_UNICODE_REGEX = new RegExp("^" + S_UNICODE_REGEX.source);
|
|
190
523
|
var S_DOLLAR_UNICODE_REGEX = new RegExp(S_UNICODE_REGEX.source + "$");
|
|
191
524
|
|
|
192
|
-
// bazel-out/darwin-fastbuild/bin/packages/ecma402-abstract/lib/
|
|
193
|
-
|
|
194
|
-
var candidate = locale;
|
|
195
|
-
while (true) {
|
|
196
|
-
if (availableLocales.has(candidate)) {
|
|
197
|
-
return candidate;
|
|
198
|
-
}
|
|
199
|
-
var pos = candidate.lastIndexOf("-");
|
|
200
|
-
if (!~pos) {
|
|
201
|
-
return void 0;
|
|
202
|
-
}
|
|
203
|
-
if (pos >= 2 && candidate[pos - 2] === "-") {
|
|
204
|
-
pos -= 2;
|
|
205
|
-
}
|
|
206
|
-
candidate = candidate.slice(0, pos);
|
|
207
|
-
}
|
|
208
|
-
}
|
|
209
|
-
|
|
210
|
-
// bazel-out/darwin-fastbuild/bin/packages/ecma402-abstract/lib/LookupMatcher.js
|
|
211
|
-
function LookupMatcher(availableLocales, requestedLocales, getDefaultLocale) {
|
|
212
|
-
var result = {locale: ""};
|
|
213
|
-
for (var _i = 0, requestedLocales_1 = requestedLocales; _i < requestedLocales_1.length; _i++) {
|
|
214
|
-
var locale = requestedLocales_1[_i];
|
|
215
|
-
var noExtensionLocale = locale.replace(UNICODE_EXTENSION_SEQUENCE_REGEX, "");
|
|
216
|
-
var availableLocale = BestAvailableLocale(availableLocales, noExtensionLocale);
|
|
217
|
-
if (availableLocale) {
|
|
218
|
-
result.locale = availableLocale;
|
|
219
|
-
if (locale !== noExtensionLocale) {
|
|
220
|
-
result.extension = locale.slice(noExtensionLocale.length + 1, locale.length);
|
|
221
|
-
}
|
|
222
|
-
return result;
|
|
223
|
-
}
|
|
224
|
-
}
|
|
225
|
-
result.locale = getDefaultLocale();
|
|
226
|
-
return result;
|
|
227
|
-
}
|
|
228
|
-
|
|
229
|
-
// bazel-out/darwin-fastbuild/bin/packages/ecma402-abstract/lib/BestFitMatcher.js
|
|
230
|
-
function BestFitMatcher(availableLocales, requestedLocales, getDefaultLocale) {
|
|
231
|
-
var minimizedAvailableLocaleMap = {};
|
|
232
|
-
var minimizedAvailableLocales = new Set();
|
|
233
|
-
availableLocales.forEach(function(locale2) {
|
|
234
|
-
var minimizedLocale = new Intl.Locale(locale2).minimize().toString();
|
|
235
|
-
minimizedAvailableLocaleMap[minimizedLocale] = locale2;
|
|
236
|
-
minimizedAvailableLocales.add(minimizedLocale);
|
|
237
|
-
});
|
|
238
|
-
var foundLocale;
|
|
239
|
-
for (var _i = 0, requestedLocales_1 = requestedLocales; _i < requestedLocales_1.length; _i++) {
|
|
240
|
-
var l = requestedLocales_1[_i];
|
|
241
|
-
if (foundLocale) {
|
|
242
|
-
break;
|
|
243
|
-
}
|
|
244
|
-
var noExtensionLocale = l.replace(UNICODE_EXTENSION_SEQUENCE_REGEX, "");
|
|
245
|
-
if (availableLocales.has(noExtensionLocale)) {
|
|
246
|
-
foundLocale = noExtensionLocale;
|
|
247
|
-
break;
|
|
248
|
-
}
|
|
249
|
-
if (minimizedAvailableLocales.has(noExtensionLocale)) {
|
|
250
|
-
foundLocale = minimizedAvailableLocaleMap[noExtensionLocale];
|
|
251
|
-
break;
|
|
252
|
-
}
|
|
253
|
-
var locale = new Intl.Locale(noExtensionLocale);
|
|
254
|
-
var maximizedRequestedLocale = locale.maximize().toString();
|
|
255
|
-
var minimizedRequestedLocale = locale.minimize().toString();
|
|
256
|
-
if (minimizedAvailableLocales.has(minimizedRequestedLocale)) {
|
|
257
|
-
foundLocale = minimizedAvailableLocaleMap[minimizedRequestedLocale];
|
|
258
|
-
break;
|
|
259
|
-
}
|
|
260
|
-
foundLocale = BestAvailableLocale(minimizedAvailableLocales, maximizedRequestedLocale);
|
|
261
|
-
}
|
|
262
|
-
return {
|
|
263
|
-
locale: foundLocale || getDefaultLocale()
|
|
264
|
-
};
|
|
265
|
-
}
|
|
266
|
-
|
|
267
|
-
// bazel-out/darwin-fastbuild/bin/packages/ecma402-abstract/lib/UnicodeExtensionValue.js
|
|
268
|
-
function UnicodeExtensionValue(extension, key) {
|
|
269
|
-
invariant(key.length === 2, "key must have 2 elements");
|
|
270
|
-
var size = extension.length;
|
|
271
|
-
var searchValue = "-" + key + "-";
|
|
272
|
-
var pos = extension.indexOf(searchValue);
|
|
273
|
-
if (pos !== -1) {
|
|
274
|
-
var start = pos + 4;
|
|
275
|
-
var end = start;
|
|
276
|
-
var k = start;
|
|
277
|
-
var done = false;
|
|
278
|
-
while (!done) {
|
|
279
|
-
var e = extension.indexOf("-", k);
|
|
280
|
-
var len = void 0;
|
|
281
|
-
if (e === -1) {
|
|
282
|
-
len = size - k;
|
|
283
|
-
} else {
|
|
284
|
-
len = e - k;
|
|
285
|
-
}
|
|
286
|
-
if (len === 2) {
|
|
287
|
-
done = true;
|
|
288
|
-
} else if (e === -1) {
|
|
289
|
-
end = size;
|
|
290
|
-
done = true;
|
|
291
|
-
} else {
|
|
292
|
-
end = e;
|
|
293
|
-
k = e + 1;
|
|
294
|
-
}
|
|
295
|
-
}
|
|
296
|
-
return extension.slice(start, end);
|
|
297
|
-
}
|
|
298
|
-
searchValue = "-" + key;
|
|
299
|
-
pos = extension.indexOf(searchValue);
|
|
300
|
-
if (pos !== -1 && pos + 3 === size) {
|
|
301
|
-
return "";
|
|
302
|
-
}
|
|
303
|
-
return void 0;
|
|
304
|
-
}
|
|
305
|
-
|
|
306
|
-
// bazel-out/darwin-fastbuild/bin/packages/ecma402-abstract/lib/ResolveLocale.js
|
|
307
|
-
function ResolveLocale(availableLocales, requestedLocales, options, relevantExtensionKeys, localeData, getDefaultLocale) {
|
|
308
|
-
var matcher = options.localeMatcher;
|
|
309
|
-
var r;
|
|
310
|
-
if (matcher === "lookup") {
|
|
311
|
-
r = LookupMatcher(availableLocales, requestedLocales, getDefaultLocale);
|
|
312
|
-
} else {
|
|
313
|
-
r = BestFitMatcher(availableLocales, requestedLocales, getDefaultLocale);
|
|
314
|
-
}
|
|
315
|
-
var foundLocale = r.locale;
|
|
316
|
-
var result = {locale: "", dataLocale: foundLocale};
|
|
317
|
-
var supportedExtension = "-u";
|
|
318
|
-
for (var _i = 0, relevantExtensionKeys_1 = relevantExtensionKeys; _i < relevantExtensionKeys_1.length; _i++) {
|
|
319
|
-
var key = relevantExtensionKeys_1[_i];
|
|
320
|
-
invariant(foundLocale in localeData, "Missing locale data for " + foundLocale);
|
|
321
|
-
var foundLocaleData = localeData[foundLocale];
|
|
322
|
-
invariant(typeof foundLocaleData === "object" && foundLocaleData !== null, "locale data " + key + " must be an object");
|
|
323
|
-
var keyLocaleData = foundLocaleData[key];
|
|
324
|
-
invariant(Array.isArray(keyLocaleData), "keyLocaleData for " + key + " must be an array");
|
|
325
|
-
var value = keyLocaleData[0];
|
|
326
|
-
invariant(typeof value === "string" || value === null, "value must be string or null but got " + typeof value + " in key " + key);
|
|
327
|
-
var supportedExtensionAddition = "";
|
|
328
|
-
if (r.extension) {
|
|
329
|
-
var requestedValue = UnicodeExtensionValue(r.extension, key);
|
|
330
|
-
if (requestedValue !== void 0) {
|
|
331
|
-
if (requestedValue !== "") {
|
|
332
|
-
if (~keyLocaleData.indexOf(requestedValue)) {
|
|
333
|
-
value = requestedValue;
|
|
334
|
-
supportedExtensionAddition = "-" + key + "-" + value;
|
|
335
|
-
}
|
|
336
|
-
} else if (~requestedValue.indexOf("true")) {
|
|
337
|
-
value = "true";
|
|
338
|
-
supportedExtensionAddition = "-" + key;
|
|
339
|
-
}
|
|
340
|
-
}
|
|
341
|
-
}
|
|
342
|
-
if (key in options) {
|
|
343
|
-
var optionsValue = options[key];
|
|
344
|
-
invariant(typeof optionsValue === "string" || typeof optionsValue === "undefined" || optionsValue === null, "optionsValue must be String, Undefined or Null");
|
|
345
|
-
if (~keyLocaleData.indexOf(optionsValue)) {
|
|
346
|
-
if (optionsValue !== value) {
|
|
347
|
-
value = optionsValue;
|
|
348
|
-
supportedExtensionAddition = "";
|
|
349
|
-
}
|
|
350
|
-
}
|
|
351
|
-
}
|
|
352
|
-
result[key] = value;
|
|
353
|
-
supportedExtension += supportedExtensionAddition;
|
|
354
|
-
}
|
|
355
|
-
if (supportedExtension.length > 2) {
|
|
356
|
-
var privateIndex = foundLocale.indexOf("-x-");
|
|
357
|
-
if (privateIndex === -1) {
|
|
358
|
-
foundLocale = foundLocale + supportedExtension;
|
|
359
|
-
} else {
|
|
360
|
-
var preExtension = foundLocale.slice(0, privateIndex);
|
|
361
|
-
var postExtension = foundLocale.slice(privateIndex, foundLocale.length);
|
|
362
|
-
foundLocale = preExtension + supportedExtension + postExtension;
|
|
363
|
-
}
|
|
364
|
-
foundLocale = Intl.getCanonicalLocales(foundLocale)[0];
|
|
365
|
-
}
|
|
366
|
-
result.locale = foundLocale;
|
|
367
|
-
return result;
|
|
368
|
-
}
|
|
525
|
+
// bazel-out/darwin-fastbuild/bin/packages/ecma402-abstract/lib/NumberFormat/InitializeNumberFormat.js
|
|
526
|
+
var import_intl_localematcher = __toModule(require_intl_localematcher());
|
|
369
527
|
|
|
370
528
|
// bazel-out/darwin-fastbuild/bin/packages/ecma402-abstract/lib/PartitionPattern.js
|
|
371
529
|
function PartitionPattern(pattern) {
|
|
@@ -399,21 +557,8 @@
|
|
|
399
557
|
return result;
|
|
400
558
|
}
|
|
401
559
|
|
|
402
|
-
// bazel-out/darwin-fastbuild/bin/packages/ecma402-abstract/lib/LookupSupportedLocales.js
|
|
403
|
-
function LookupSupportedLocales(availableLocales, requestedLocales) {
|
|
404
|
-
var subset = [];
|
|
405
|
-
for (var _i = 0, requestedLocales_1 = requestedLocales; _i < requestedLocales_1.length; _i++) {
|
|
406
|
-
var locale = requestedLocales_1[_i];
|
|
407
|
-
var noExtensionLocale = locale.replace(UNICODE_EXTENSION_SEQUENCE_REGEX, "");
|
|
408
|
-
var availableLocale = BestAvailableLocale(availableLocales, noExtensionLocale);
|
|
409
|
-
if (availableLocale) {
|
|
410
|
-
subset.push(availableLocale);
|
|
411
|
-
}
|
|
412
|
-
}
|
|
413
|
-
return subset;
|
|
414
|
-
}
|
|
415
|
-
|
|
416
560
|
// bazel-out/darwin-fastbuild/bin/packages/ecma402-abstract/lib/SupportedLocales.js
|
|
561
|
+
var import_intl_localematcher2 = __toModule(require_intl_localematcher());
|
|
417
562
|
function SupportedLocales(availableLocales, requestedLocales, options) {
|
|
418
563
|
var matcher = "best fit";
|
|
419
564
|
if (options !== void 0) {
|
|
@@ -421,9 +566,9 @@
|
|
|
421
566
|
matcher = GetOption(options, "localeMatcher", "string", ["lookup", "best fit"], "best fit");
|
|
422
567
|
}
|
|
423
568
|
if (matcher === "best fit") {
|
|
424
|
-
return LookupSupportedLocales(availableLocales, requestedLocales);
|
|
569
|
+
return (0, import_intl_localematcher2.LookupSupportedLocales)(availableLocales, requestedLocales);
|
|
425
570
|
}
|
|
426
|
-
return LookupSupportedLocales(availableLocales, requestedLocales);
|
|
571
|
+
return (0, import_intl_localematcher2.LookupSupportedLocales)(availableLocales, requestedLocales);
|
|
427
572
|
}
|
|
428
573
|
|
|
429
574
|
// bazel-out/darwin-fastbuild/bin/packages/ecma402-abstract/lib/data.js
|
|
@@ -446,6 +591,7 @@
|
|
|
446
591
|
})(RangePatternType || (RangePatternType = {}));
|
|
447
592
|
|
|
448
593
|
// bazel-out/darwin-fastbuild/bin/packages/intl-listformat/lib/index.js
|
|
594
|
+
var import_intl_localematcher3 = __toModule(require_intl_localematcher());
|
|
449
595
|
function validateInstance(instance, method) {
|
|
450
596
|
if (!(instance instanceof ListFormat)) {
|
|
451
597
|
throw new TypeError("Method Intl.ListFormat.prototype." + method + " called on incompatible receiver " + String(instance));
|
|
@@ -533,7 +679,7 @@
|
|
|
533
679
|
var matcher = GetOption(opts, "localeMatcher", "string", ["best fit", "lookup"], "best fit");
|
|
534
680
|
opt.localeMatcher = matcher;
|
|
535
681
|
var localeData = ListFormat2.localeData;
|
|
536
|
-
var r = ResolveLocale(ListFormat2.availableLocales, requestedLocales, opt, ListFormat2.relevantExtensionKeys, localeData, ListFormat2.getDefaultLocale);
|
|
682
|
+
var r = (0, import_intl_localematcher3.ResolveLocale)(ListFormat2.availableLocales, requestedLocales, opt, ListFormat2.relevantExtensionKeys, localeData, ListFormat2.getDefaultLocale);
|
|
537
683
|
setInternalSlot(ListFormat2.__INTERNAL_SLOT_MAP__, this, "locale", r.locale);
|
|
538
684
|
var type = GetOption(opts, "type", "string", ["conjunction", "disjunction", "unit"], "conjunction");
|
|
539
685
|
setInternalSlot(ListFormat2.__INTERNAL_SLOT_MAP__, this, "type", type);
|
|
@@ -639,8 +785,15 @@
|
|
|
639
785
|
}
|
|
640
786
|
|
|
641
787
|
// bazel-out/darwin-fastbuild/bin/packages/intl-listformat/lib/should-polyfill.js
|
|
642
|
-
function
|
|
643
|
-
|
|
788
|
+
function supportedLocalesOf(locale) {
|
|
789
|
+
if (!locale) {
|
|
790
|
+
return true;
|
|
791
|
+
}
|
|
792
|
+
var locales = Array.isArray(locale) ? locale : [locale];
|
|
793
|
+
return Intl.ListFormat.supportedLocalesOf(locales).length === locales.length;
|
|
794
|
+
}
|
|
795
|
+
function shouldPolyfill(locale) {
|
|
796
|
+
return !("ListFormat" in Intl) || !supportedLocalesOf(locale);
|
|
644
797
|
}
|
|
645
798
|
|
|
646
799
|
// bazel-out/darwin-fastbuild/bin/packages/intl-listformat/lib/polyfill.js
|
package/should-polyfill.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare function shouldPolyfill(): boolean;
|
|
1
|
+
export declare function shouldPolyfill(locale?: string | string[]): boolean;
|
|
2
2
|
//# sourceMappingURL=should-polyfill.d.ts.map
|
package/should-polyfill.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"should-polyfill.d.ts","sourceRoot":"","sources":["../../../../../packages/intl-listformat/should-polyfill.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"should-polyfill.d.ts","sourceRoot":"","sources":["../../../../../packages/intl-listformat/should-polyfill.ts"],"names":[],"mappings":"AAWA,wBAAgB,cAAc,CAAC,MAAM,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,WAExD"}
|
package/should-polyfill.js
CHANGED
|
@@ -1,7 +1,15 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.shouldPolyfill = void 0;
|
|
4
|
-
function
|
|
5
|
-
|
|
4
|
+
function supportedLocalesOf(locale) {
|
|
5
|
+
if (!locale) {
|
|
6
|
+
return true;
|
|
7
|
+
}
|
|
8
|
+
var locales = Array.isArray(locale) ? locale : [locale];
|
|
9
|
+
return (Intl.ListFormat.supportedLocalesOf(locales).length ===
|
|
10
|
+
locales.length);
|
|
11
|
+
}
|
|
12
|
+
function shouldPolyfill(locale) {
|
|
13
|
+
return !('ListFormat' in Intl) || !supportedLocalesOf(locale);
|
|
6
14
|
}
|
|
7
15
|
exports.shouldPolyfill = shouldPolyfill;
|