@formatjs/intl-displaynames 4.0.9 → 4.0.13
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/LICENSE.md +1 -1
- package/index.d.ts.map +1 -1
- package/index.js +1 -1
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +2 -2
- package/package.json +2 -2
- package/polyfill.iife.js +15 -1
- package/polyfill-locales.js +0 -1135
package/LICENSE.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
MIT License
|
|
2
2
|
|
|
3
|
-
Copyright (c)
|
|
3
|
+
Copyright (c) 2021 FormatJS
|
|
4
4
|
|
|
5
5
|
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
|
6
6
|
|
package/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../packages/intl-displaynames/index.ts"],"names":[],"mappings":"AAAA,OAAO,EASL,sBAAsB,EACtB,gBAAgB,EAKjB,MAAM,4BAA4B,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../packages/intl-displaynames/index.ts"],"names":[],"mappings":"AAAA,OAAO,EASL,sBAAsB,EACtB,gBAAgB,EAKjB,MAAM,4BAA4B,CAAA;AAEnC,MAAM,WAAW,mBAAmB;IAClC,aAAa,CAAC,EAAE,QAAQ,GAAG,UAAU,CAAA;IACrC,KAAK,CAAC,EAAE,QAAQ,GAAG,OAAO,GAAG,MAAM,CAAA;IACnC,IAAI,EAAE,UAAU,GAAG,QAAQ,GAAG,QAAQ,GAAG,UAAU,CAAA;IACnD,QAAQ,CAAC,EAAE,MAAM,GAAG,MAAM,CAAA;CAC3B;AAED,MAAM,WAAW,2BAA2B;IAC1C,MAAM,EAAE,MAAM,CAAA;IACd,KAAK,EAAE,WAAW,CAAC,mBAAmB,CAAC,OAAO,CAAC,CAAC,CAAA;IAChD,IAAI,EAAE,WAAW,CAAC,mBAAmB,CAAC,MAAM,CAAC,CAAC,CAAA;IAC9C,QAAQ,EAAE,WAAW,CAAC,mBAAmB,CAAC,UAAU,CAAC,CAAC,CAAA;CACvD;AAED,qBAAa,YAAY;gBAErB,OAAO,EAAE,MAAM,GAAG,MAAM,EAAE,GAAG,SAAS,EACtC,OAAO,EAAE,mBAAmB;IAmF9B,MAAM,CAAC,kBAAkB,CACvB,OAAO,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,EAC3B,OAAO,CAAC,EAAE,IAAI,CAAC,mBAAmB,EAAE,eAAe,CAAC,GACnD,MAAM,EAAE;IAQX,MAAM,CAAC,eAAe,CAAC,GAAG,IAAI,EAAE,sBAAsB,EAAE,GAAG,IAAI;IAgB/D,EAAE,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,MAAM,GAAG,SAAS;IA4DvE,eAAe,IAAI,2BAA2B;IAc9C,MAAM,CAAC,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,gBAAgB,GAAG,SAAS,CAAC,CAAK;IACpE,OAAO,CAAC,MAAM,CAAC,gBAAgB,CAAoB;IACnD,OAAO,CAAC,MAAM,CAAC,eAAe,CAAK;IACnC,OAAO,CAAC,MAAM,CAAC,gBAAgB;IAG/B,gBAAuB,UAAU,QAAO;CACzC"}
|
package/index.js
CHANGED
|
@@ -10,7 +10,7 @@ var DisplayNames = /** @class */ (function () {
|
|
|
10
10
|
throw TypeError("Constructor Intl.DisplayNames requires 'new'");
|
|
11
11
|
}
|
|
12
12
|
var requestedLocales = ecma402_abstract_1.CanonicalizeLocaleList(locales);
|
|
13
|
-
options = ecma402_abstract_1.
|
|
13
|
+
options = ecma402_abstract_1.GetOptionsObject(options);
|
|
14
14
|
var opt = Object.create(null);
|
|
15
15
|
var localeData = DisplayNames.localeData;
|
|
16
16
|
var matcher = ecma402_abstract_1.GetOption(options, 'localeMatcher', 'string', ['lookup', 'best fit'], 'best fit');
|
package/lib/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../packages/intl-displaynames/index.ts"],"names":[],"mappings":"AAAA,OAAO,EASL,sBAAsB,EACtB,gBAAgB,EAKjB,MAAM,4BAA4B,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../packages/intl-displaynames/index.ts"],"names":[],"mappings":"AAAA,OAAO,EASL,sBAAsB,EACtB,gBAAgB,EAKjB,MAAM,4BAA4B,CAAA;AAEnC,MAAM,WAAW,mBAAmB;IAClC,aAAa,CAAC,EAAE,QAAQ,GAAG,UAAU,CAAA;IACrC,KAAK,CAAC,EAAE,QAAQ,GAAG,OAAO,GAAG,MAAM,CAAA;IACnC,IAAI,EAAE,UAAU,GAAG,QAAQ,GAAG,QAAQ,GAAG,UAAU,CAAA;IACnD,QAAQ,CAAC,EAAE,MAAM,GAAG,MAAM,CAAA;CAC3B;AAED,MAAM,WAAW,2BAA2B;IAC1C,MAAM,EAAE,MAAM,CAAA;IACd,KAAK,EAAE,WAAW,CAAC,mBAAmB,CAAC,OAAO,CAAC,CAAC,CAAA;IAChD,IAAI,EAAE,WAAW,CAAC,mBAAmB,CAAC,MAAM,CAAC,CAAC,CAAA;IAC9C,QAAQ,EAAE,WAAW,CAAC,mBAAmB,CAAC,UAAU,CAAC,CAAC,CAAA;CACvD;AAED,qBAAa,YAAY;gBAErB,OAAO,EAAE,MAAM,GAAG,MAAM,EAAE,GAAG,SAAS,EACtC,OAAO,EAAE,mBAAmB;IAmF9B,MAAM,CAAC,kBAAkB,CACvB,OAAO,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,EAC3B,OAAO,CAAC,EAAE,IAAI,CAAC,mBAAmB,EAAE,eAAe,CAAC,GACnD,MAAM,EAAE;IAQX,MAAM,CAAC,eAAe,CAAC,GAAG,IAAI,EAAE,sBAAsB,EAAE,GAAG,IAAI;IAgB/D,EAAE,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,MAAM,GAAG,SAAS;IA4DvE,eAAe,IAAI,2BAA2B;IAc9C,MAAM,CAAC,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,gBAAgB,GAAG,SAAS,CAAC,CAAK;IACpE,OAAO,CAAC,MAAM,CAAC,gBAAgB,CAAoB;IACnD,OAAO,CAAC,MAAM,CAAC,eAAe,CAAK;IACnC,OAAO,CAAC,MAAM,CAAC,gBAAgB;IAG/B,gBAAuB,UAAU,QAAO;CACzC"}
|
package/lib/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { __assign } from "tslib";
|
|
2
|
-
import { getInternalSlot, setInternalSlot, GetOption, ResolveLocale, invariant, SupportedLocales, IsWellFormedCurrencyCode, getMultiInternalSlots, ToString, CanonicalizeLocaleList,
|
|
2
|
+
import { getInternalSlot, setInternalSlot, GetOption, ResolveLocale, invariant, SupportedLocales, IsWellFormedCurrencyCode, getMultiInternalSlots, ToString, CanonicalizeLocaleList, GetOptionsObject, CanonicalCodeForDisplayNames, } from '@formatjs/ecma402-abstract';
|
|
3
3
|
var DisplayNames = /** @class */ (function () {
|
|
4
4
|
function DisplayNames(locales, options) {
|
|
5
5
|
var _newTarget = this.constructor;
|
|
@@ -7,7 +7,7 @@ var DisplayNames = /** @class */ (function () {
|
|
|
7
7
|
throw TypeError("Constructor Intl.DisplayNames requires 'new'");
|
|
8
8
|
}
|
|
9
9
|
var requestedLocales = CanonicalizeLocaleList(locales);
|
|
10
|
-
options =
|
|
10
|
+
options = GetOptionsObject(options);
|
|
11
11
|
var opt = Object.create(null);
|
|
12
12
|
var localeData = DisplayNames.localeData;
|
|
13
13
|
var matcher = GetOption(options, 'localeMatcher', 'string', ['lookup', 'best fit'], 'best fit');
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@formatjs/intl-displaynames",
|
|
3
|
-
"version": "4.0.
|
|
3
|
+
"version": "4.0.13",
|
|
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.6.
|
|
24
|
+
"@formatjs/ecma402-abstract": "1.6.5",
|
|
25
25
|
"tslib": "^2.1.0"
|
|
26
26
|
},
|
|
27
27
|
"bugs": {
|
package/polyfill.iife.js
CHANGED
|
@@ -115,6 +115,9 @@
|
|
|
115
115
|
|
|
116
116
|
// bazel-out/k8-fastbuild/bin/packages/ecma402-abstract/lib/GetOption.js
|
|
117
117
|
function GetOption(opts, prop, type, values, fallback) {
|
|
118
|
+
if (typeof opts !== "object") {
|
|
119
|
+
throw new TypeError("Options must be an object");
|
|
120
|
+
}
|
|
118
121
|
var value = opts[prop];
|
|
119
122
|
if (value !== void 0) {
|
|
120
123
|
if (type !== "boolean" && type !== "string") {
|
|
@@ -364,6 +367,17 @@
|
|
|
364
367
|
return code.toUpperCase();
|
|
365
368
|
}
|
|
366
369
|
|
|
370
|
+
// bazel-out/k8-fastbuild/bin/packages/ecma402-abstract/lib/GetOptionsObject.js
|
|
371
|
+
function GetOptionsObject(options) {
|
|
372
|
+
if (typeof options === "undefined") {
|
|
373
|
+
return Object.create(null);
|
|
374
|
+
}
|
|
375
|
+
if (typeof options === "object") {
|
|
376
|
+
return options;
|
|
377
|
+
}
|
|
378
|
+
throw new TypeError("Options must be an object");
|
|
379
|
+
}
|
|
380
|
+
|
|
367
381
|
// bazel-out/k8-fastbuild/bin/packages/ecma402-abstract/lib/IsSanctionedSimpleUnitIdentifier.js
|
|
368
382
|
var SANCTIONED_UNITS = [
|
|
369
383
|
"angle-degree",
|
|
@@ -466,7 +480,7 @@
|
|
|
466
480
|
throw TypeError("Constructor Intl.DisplayNames requires 'new'");
|
|
467
481
|
}
|
|
468
482
|
var requestedLocales = CanonicalizeLocaleList(locales);
|
|
469
|
-
options =
|
|
483
|
+
options = GetOptionsObject(options);
|
|
470
484
|
var opt = Object.create(null);
|
|
471
485
|
var localeData = DisplayNames2.localeData;
|
|
472
486
|
var matcher = GetOption(options, "localeMatcher", "string", ["lookup", "best fit"], "best fit");
|