@formatjs/intl-datetimeformat 6.16.4 → 6.16.5

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.
Files changed (58) hide show
  1. package/index.js +0 -1
  2. package/lib/index.js +0 -1
  3. package/lib/polyfill-force.js +0 -1
  4. package/lib/polyfill.js +0 -1
  5. package/lib/should-polyfill.js +0 -1
  6. package/lib/src/abstract/BasicFormatMatcher.js +0 -1
  7. package/lib/src/abstract/BestFitFormatMatcher.js +0 -1
  8. package/lib/src/abstract/DateTimeStyleFormat.js +0 -1
  9. package/lib/src/abstract/FormatDateTime.js +0 -1
  10. package/lib/src/abstract/FormatDateTimePattern.js +0 -1
  11. package/lib/src/abstract/FormatDateTimeRange.js +0 -1
  12. package/lib/src/abstract/FormatDateTimeRangeToParts.js +0 -1
  13. package/lib/src/abstract/FormatDateTimeToParts.js +0 -1
  14. package/lib/src/abstract/InitializeDateTimeFormat.js +0 -1
  15. package/lib/src/abstract/PartitionDateTimePattern.js +0 -1
  16. package/lib/src/abstract/PartitionDateTimeRangePattern.js +0 -1
  17. package/lib/src/abstract/ToDateTimeOptions.js +0 -1
  18. package/lib/src/abstract/ToLocalTime.js +0 -1
  19. package/lib/src/abstract/skeleton.js +0 -1
  20. package/lib/src/abstract/utils.js +0 -1
  21. package/lib/src/core.js +0 -1
  22. package/lib/src/data/all-tz.js +0 -1
  23. package/lib/src/data/links.js +0 -1
  24. package/lib/src/get_internal_slots.js +0 -1
  25. package/lib/src/packer.js +0 -1
  26. package/lib/src/to_locale_string.js +0 -1
  27. package/lib/src/types.js +0 -1
  28. package/lib/supported-locales.generated.js +0 -1
  29. package/lib/test262-main.js +0 -1
  30. package/package.json +5 -5
  31. package/polyfill-force.js +0 -1
  32. package/polyfill.iife.js +142 -74
  33. package/polyfill.js +0 -1
  34. package/should-polyfill.js +0 -1
  35. package/src/abstract/BasicFormatMatcher.js +0 -1
  36. package/src/abstract/BestFitFormatMatcher.js +0 -1
  37. package/src/abstract/DateTimeStyleFormat.js +0 -1
  38. package/src/abstract/FormatDateTime.js +0 -1
  39. package/src/abstract/FormatDateTimePattern.js +0 -1
  40. package/src/abstract/FormatDateTimeRange.js +0 -1
  41. package/src/abstract/FormatDateTimeRangeToParts.js +0 -1
  42. package/src/abstract/FormatDateTimeToParts.js +0 -1
  43. package/src/abstract/InitializeDateTimeFormat.js +0 -1
  44. package/src/abstract/PartitionDateTimePattern.js +0 -1
  45. package/src/abstract/PartitionDateTimeRangePattern.js +0 -1
  46. package/src/abstract/ToDateTimeOptions.js +0 -1
  47. package/src/abstract/ToLocalTime.js +0 -1
  48. package/src/abstract/skeleton.js +0 -1
  49. package/src/abstract/utils.js +0 -1
  50. package/src/core.js +0 -1
  51. package/src/data/all-tz.js +0 -1
  52. package/src/data/links.js +0 -1
  53. package/src/get_internal_slots.js +0 -1
  54. package/src/packer.js +0 -1
  55. package/src/to_locale_string.js +0 -1
  56. package/src/types.js +0 -1
  57. package/supported-locales.generated.js +0 -1
  58. package/test262-main.js +0 -1
package/index.js CHANGED
@@ -2,4 +2,3 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  var tslib_1 = require("tslib");
4
4
  tslib_1.__exportStar(require("./src/core"), exports);
5
- //# sourceMappingURL=index.js.map
package/lib/index.js CHANGED
@@ -1,2 +1 @@
1
1
  export * from './src/core';
2
- //# sourceMappingURL=index.js.map
@@ -42,4 +42,3 @@ defineProperty(Date.prototype, 'toLocaleTimeString', {
42
42
  }
43
43
  },
44
44
  });
45
- //# sourceMappingURL=polyfill-force.js.map
package/lib/polyfill.js CHANGED
@@ -35,4 +35,3 @@ if (shouldPolyfill()) {
35
35
  },
36
36
  });
37
37
  }
38
- //# sourceMappingURL=polyfill.js.map
@@ -59,4 +59,3 @@ export function shouldPolyfill(locale) {
59
59
  return locale ? match([locale], supportedLocales, 'en') : undefined;
60
60
  }
61
61
  }
62
- //# sourceMappingURL=should-polyfill.js.map
@@ -104,4 +104,3 @@ export function BasicFormatMatcher(options, formats) {
104
104
  }
105
105
  return __assign({}, bestFormat);
106
106
  }
107
- //# sourceMappingURL=BasicFormatMatcher.js.map
@@ -114,4 +114,3 @@ export function BestFitFormatMatcher(options, formats) {
114
114
  patternFormat.rangePatterns12 = skeletonFormat.rangePatterns12;
115
115
  return patternFormat;
116
116
  }
117
- //# sourceMappingURL=BestFitFormatMatcher.js.map
@@ -48,4 +48,3 @@ export function DateTimeStyleFormat(dateStyle, timeStyle, dataLocaleData) {
48
48
  invariant(dateStyle !== undefined, 'dateStyle should not be undefined');
49
49
  return dateFormat;
50
50
  }
51
- //# sourceMappingURL=DateTimeStyleFormat.js.map
@@ -13,4 +13,3 @@ export function FormatDateTime(dtf, x, implDetails) {
13
13
  }
14
14
  return result;
15
15
  }
16
- //# sourceMappingURL=FormatDateTime.js.map
@@ -184,4 +184,3 @@ export function FormatDateTimePattern(dtf, patternParts, x, _a) {
184
184
  }
185
185
  return result;
186
186
  }
187
- //# sourceMappingURL=FormatDateTimePattern.js.map
@@ -8,4 +8,3 @@ export function FormatDateTimeRange(dtf, x, y, implDetails) {
8
8
  }
9
9
  return result;
10
10
  }
11
- //# sourceMappingURL=FormatDateTimeRange.js.map
@@ -12,4 +12,3 @@ export function FormatDateTimeRangeToParts(dtf, x, y, implDetails) {
12
12
  }
13
13
  return result;
14
14
  }
15
- //# sourceMappingURL=FormatDateTimeRangeToParts.js.map
@@ -19,4 +19,3 @@ export function FormatDateTimeToParts(dtf, x, implDetails) {
19
19
  }
20
20
  return result;
21
21
  }
22
- //# sourceMappingURL=FormatDateTimeToParts.js.map
@@ -188,4 +188,3 @@ export function InitializeDateTimeFormat(dtf, locales, opts, _a) {
188
188
  internalSlots.rangePatterns = rangePatterns;
189
189
  return dtf; // TODO: remove this when https://github.com/microsoft/TypeScript/pull/50402 is merged
190
190
  }
191
- //# sourceMappingURL=InitializeDateTimeFormat.js.map
@@ -17,4 +17,3 @@ export function PartitionDateTimePattern(dtf, x, implDetails) {
17
17
  var pattern = internalSlots.pattern;
18
18
  return FormatDateTimePattern(dtf, PartitionPattern(pattern), x, implDetails);
19
19
  }
20
- //# sourceMappingURL=PartitionDateTimePattern.js.map
@@ -117,4 +117,3 @@ export function PartitionDateTimeRangePattern(dtf, x, y, implDetails) {
117
117
  }
118
118
  return result;
119
119
  }
120
- //# sourceMappingURL=PartitionDateTimeRangePattern.js.map
@@ -61,4 +61,3 @@ export function ToDateTimeOptions(options, required, defaults) {
61
61
  }
62
62
  return options;
63
63
  }
64
- //# sourceMappingURL=ToDateTimeOptions.js.map
@@ -48,4 +48,3 @@ export function ToLocalTime(t, calendar, timeZone, _a) {
48
48
  timeZoneOffset: timeZoneOffset,
49
49
  };
50
50
  }
51
- //# sourceMappingURL=ToLocalTime.js.map
@@ -292,4 +292,3 @@ export function splitRangePattern(pattern) {
292
292
  },
293
293
  ];
294
294
  }
295
- //# sourceMappingURL=skeleton.js.map
@@ -19,4 +19,3 @@ export var longMorePenalty = 6;
19
19
  export var shortLessPenalty = 6;
20
20
  export var shortMorePenalty = 3;
21
21
  export var offsetPenalty = 1;
22
- //# sourceMappingURL=utils.js.map
package/lib/src/core.js CHANGED
@@ -308,4 +308,3 @@ try {
308
308
  catch (e) {
309
309
  // Meta fix so we're test262-compliant, not important
310
310
  }
311
- //# sourceMappingURL=core.js.map
@@ -458,4 +458,3 @@ export default {
458
458
  "Pacific/Wallis|,0,372,0|-100f9dh,0,372,0|-100f9dg,99,192,0|NaN,99,192,0"
459
459
  ]
460
460
  };
461
- //# sourceMappingURL=all-tz.js.map
@@ -258,4 +258,3 @@ export default {
258
258
  "WET": "Europe/Lisbon",
259
259
  "Zulu": "Etc/UTC"
260
260
  };
261
- //# sourceMappingURL=links.js.map
@@ -9,4 +9,3 @@ export default function getInternalSlots(x) {
9
9
  }
10
10
  return internalSlots;
11
11
  }
12
- //# sourceMappingURL=get_internal_slots.js.map
package/lib/src/packer.js CHANGED
@@ -37,4 +37,3 @@ export function unpack(data) {
37
37
  }
38
38
  return zones;
39
39
  }
40
- //# sourceMappingURL=packer.js.map
@@ -17,4 +17,3 @@ export function toLocaleTimeString(x, locales, options) {
17
17
  var dtf = new DateTimeFormat(locales, ToDateTimeOptions(options, 'time', 'time'));
18
18
  return dtf.format(x);
19
19
  }
20
- //# sourceMappingURL=to_locale_string.js.map
package/lib/src/types.js CHANGED
@@ -1,2 +1 @@
1
1
  export {};
2
- //# sourceMappingURL=types.js.map
@@ -1,2 +1 @@
1
1
  export var supportedLocales = ["af", "af-NA", "agq", "ak", "am", "ar", "ar-AE", "ar-BH", "ar-DJ", "ar-DZ", "ar-EG", "ar-EH", "ar-ER", "ar-IL", "ar-IQ", "ar-JO", "ar-KM", "ar-KW", "ar-LB", "ar-LY", "ar-MA", "ar-MR", "ar-OM", "ar-PS", "ar-QA", "ar-SA", "ar-SD", "ar-SO", "ar-SS", "ar-SY", "ar-TD", "ar-TN", "ar-YE", "as", "asa", "ast", "az", "az-Cyrl", "az-Latn", "bas", "be", "be-tarask", "bem", "bez", "bg", "bm", "bn", "bn-IN", "bo", "bo-IN", "br", "brx", "bs", "bs-Cyrl", "bs-Latn", "ca", "ca-AD", "ca-ES-valencia", "ca-FR", "ca-IT", "ccp", "ccp-IN", "ce", "ceb", "cgg", "chr", "ckb", "ckb-IR", "cs", "cy", "da", "da-GL", "dav", "de", "de-AT", "de-BE", "de-CH", "de-IT", "de-LI", "de-LU", "dje", "doi", "dsb", "dua", "dyo", "dz", "ebu", "ee", "ee-TG", "el", "el-CY", "en", "en-001", "en-150", "en-AE", "en-AG", "en-AI", "en-AS", "en-AT", "en-AU", "en-BB", "en-BE", "en-BI", "en-BM", "en-BS", "en-BW", "en-BZ", "en-CA", "en-CC", "en-CH", "en-CK", "en-CM", "en-CX", "en-CY", "en-DE", "en-DG", "en-DK", "en-DM", "en-ER", "en-FI", "en-FJ", "en-FK", "en-FM", "en-GB", "en-GD", "en-GG", "en-GH", "en-GI", "en-GM", "en-GU", "en-GY", "en-HK", "en-IE", "en-IL", "en-IM", "en-IN", "en-IO", "en-JE", "en-JM", "en-KE", "en-KI", "en-KN", "en-KY", "en-LC", "en-LR", "en-LS", "en-MG", "en-MH", "en-MO", "en-MP", "en-MS", "en-MT", "en-MU", "en-MW", "en-MY", "en-NA", "en-NF", "en-NG", "en-NL", "en-NR", "en-NU", "en-NZ", "en-PG", "en-PH", "en-PK", "en-PN", "en-PR", "en-PW", "en-RW", "en-SB", "en-SC", "en-SD", "en-SE", "en-SG", "en-SH", "en-SI", "en-SL", "en-SS", "en-SX", "en-SZ", "en-TC", "en-TK", "en-TO", "en-TT", "en-TV", "en-TZ", "en-UG", "en-UM", "en-VC", "en-VG", "en-VI", "en-VU", "en-WS", "en-ZA", "en-ZM", "en-ZW", "eo", "es", "es-419", "es-AR", "es-BO", "es-BR", "es-BZ", "es-CL", "es-CO", "es-CR", "es-CU", "es-DO", "es-EA", "es-EC", "es-GQ", "es-GT", "es-HN", "es-IC", "es-MX", "es-NI", "es-PA", "es-PE", "es-PH", "es-PR", "es-PY", "es-SV", "es-US", "es-UY", "es-VE", "et", "eu", "ewo", "fa", "fa-AF", "ff", "ff-Adlm", "ff-Adlm-BF", "ff-Adlm-CM", "ff-Adlm-GH", "ff-Adlm-GM", "ff-Adlm-GW", "ff-Adlm-LR", "ff-Adlm-MR", "ff-Adlm-NE", "ff-Adlm-NG", "ff-Adlm-SL", "ff-Adlm-SN", "ff-Latn", "ff-Latn-BF", "ff-Latn-CM", "ff-Latn-GH", "ff-Latn-GM", "ff-Latn-GN", "ff-Latn-GW", "ff-Latn-LR", "ff-Latn-MR", "ff-Latn-NE", "ff-Latn-NG", "ff-Latn-SL", "fi", "fil", "fo", "fo-DK", "fr", "fr-BE", "fr-BF", "fr-BI", "fr-BJ", "fr-BL", "fr-CA", "fr-CD", "fr-CF", "fr-CG", "fr-CH", "fr-CI", "fr-CM", "fr-DJ", "fr-DZ", "fr-GA", "fr-GF", "fr-GN", "fr-GP", "fr-GQ", "fr-HT", "fr-KM", "fr-LU", "fr-MA", "fr-MC", "fr-MF", "fr-MG", "fr-ML", "fr-MQ", "fr-MR", "fr-MU", "fr-NC", "fr-NE", "fr-PF", "fr-PM", "fr-RE", "fr-RW", "fr-SC", "fr-SN", "fr-SY", "fr-TD", "fr-TG", "fr-TN", "fr-VU", "fr-WF", "fr-YT", "fur", "fy", "ga", "ga-GB", "gd", "gl", "gsw", "gsw-FR", "gsw-LI", "gu", "guz", "gv", "ha", "ha-GH", "ha-NE", "haw", "he", "hi", "hr", "hr-BA", "hsb", "hu", "hy", "ia", "id", "ig", "ii", "is", "it", "it-CH", "it-SM", "it-VA", "ja", "jgo", "jmc", "jv", "ka", "kab", "kam", "kde", "kea", "kgp", "khq", "ki", "kk", "kkj", "kl", "kln", "km", "kn", "ko", "ko-KP", "kok", "ks", "ks-Arab", "ksb", "ksf", "ksh", "ku", "kw", "ky", "lag", "lb", "lg", "lkt", "ln", "ln-AO", "ln-CF", "ln-CG", "lo", "lrc", "lrc-IQ", "lt", "lu", "luo", "luy", "lv", "mai", "mas", "mas-TZ", "mer", "mfe", "mg", "mgh", "mgo", "mi", "mk", "ml", "mn", "mni", "mni-Beng", "mr", "ms", "ms-BN", "ms-ID", "ms-SG", "mt", "mua", "my", "mzn", "naq", "nb", "nb-SJ", "nd", "nds", "nds-NL", "ne", "ne-IN", "nl", "nl-AW", "nl-BE", "nl-BQ", "nl-CW", "nl-SR", "nl-SX", "nmg", "nn", "nnh", "no", "nus", "nyn", "om", "om-KE", "or", "os", "os-RU", "pa", "pa-Arab", "pa-Guru", "pcm", "pl", "ps", "ps-PK", "pt", "pt-AO", "pt-CH", "pt-CV", "pt-GQ", "pt-GW", "pt-LU", "pt-MO", "pt-MZ", "pt-PT", "pt-ST", "pt-TL", "qu", "qu-BO", "qu-EC", "rm", "rn", "ro", "ro-MD", "rof", "ru", "ru-BY", "ru-KG", "ru-KZ", "ru-MD", "ru-UA", "rw", "rwk", "sa", "sah", "saq", "sat", "sat-Olck", "sbp", "sc", "sd", "sd-Arab", "sd-Deva", "se", "se-FI", "se-SE", "seh", "ses", "sg", "shi", "shi-Latn", "shi-Tfng", "si", "sk", "sl", "smn", "sn", "so", "so-DJ", "so-ET", "so-KE", "sq", "sq-MK", "sq-XK", "sr", "sr-Cyrl", "sr-Cyrl-BA", "sr-Cyrl-ME", "sr-Cyrl-XK", "sr-Latn", "sr-Latn-BA", "sr-Latn-ME", "sr-Latn-XK", "su", "su-Latn", "sv", "sv-AX", "sv-FI", "sw", "sw-CD", "sw-KE", "sw-UG", "ta", "ta-LK", "ta-MY", "ta-SG", "te", "teo", "teo-KE", "tg", "th", "ti", "ti-ER", "tk", "to", "tr", "tr-CY", "tt", "twq", "tzm", "ug", "uk", "und", "ur", "ur-IN", "uz", "uz-Arab", "uz-Cyrl", "uz-Latn", "vai", "vai-Latn", "vai-Vaii", "vi", "vun", "wae", "wo", "xh", "xog", "yav", "yi", "yo", "yo-BJ", "yrl", "yrl-CO", "yrl-VE", "yue", "yue-Hans", "yue-Hant", "zgh", "zh", "zh-Hans", "zh-Hans-HK", "zh-Hans-MO", "zh-Hans-SG", "zh-Hant", "zh-Hant-HK", "zh-Hant-MO", "zu"];
2
- //# sourceMappingURL=supported-locales.generated.js.map
@@ -23784,4 +23784,3 @@ Intl.DateTimeFormat.__addLocaleData({
23784
23784
  "locale": "zh"
23785
23785
  });
23786
23786
  Intl.DateTimeFormat.__addTZData(allData);
23787
- //# sourceMappingURL=test262-main.js.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@formatjs/intl-datetimeformat",
3
- "version": "6.16.4",
3
+ "version": "6.16.5",
4
4
  "description": "Intl.DateTimeFormat polyfill",
5
5
  "main": "index.js",
6
6
  "types": "index.d.ts",
@@ -23,11 +23,11 @@
23
23
  "homepage": "https://github.com/formatjs/formatjs#readme",
24
24
  "dependencies": {
25
25
  "tslib": "2",
26
- "@formatjs/intl-localematcher": "0.5.7",
27
- "@formatjs/ecma402-abstract": "2.2.3"
26
+ "@formatjs/ecma402-abstract": "2.2.4",
27
+ "@formatjs/intl-localematcher": "0.5.8"
28
28
  },
29
29
  "devDependencies": {
30
- "@formatjs/intl-locale": "4.2.4",
31
- "@formatjs/intl-getcanonicallocales": "2.5.2"
30
+ "@formatjs/intl-getcanonicallocales": "2.5.3",
31
+ "@formatjs/intl-locale": "4.2.5"
32
32
  }
33
33
  }
package/polyfill-force.js CHANGED
@@ -44,4 +44,3 @@ var to_locale_string_1 = require("./src/to_locale_string");
44
44
  }
45
45
  },
46
46
  });
47
- //# sourceMappingURL=polyfill-force.js.map
package/polyfill.iife.js CHANGED
@@ -4732,6 +4732,50 @@
4732
4732
  };
4733
4733
  }
4734
4734
 
4735
+ // node_modules/.aspect_rules_js/@formatjs+intl-localematcher@0.0.0/node_modules/@formatjs/intl-localematcher/lib/abstract/CanonicalizeUValue.js
4736
+ function CanonicalizeUValue(ukey, uvalue) {
4737
+ var lowerValue = uvalue.toLowerCase();
4738
+ invariant2(ukey !== void 0, "ukey must be defined");
4739
+ var canonicalized = lowerValue;
4740
+ return canonicalized;
4741
+ }
4742
+
4743
+ // node_modules/.aspect_rules_js/@formatjs+intl-localematcher@0.0.0/node_modules/@formatjs/intl-localematcher/lib/abstract/CanonicalizeUnicodeLocaleId.js
4744
+ function CanonicalizeUnicodeLocaleId(locale) {
4745
+ return Intl.getCanonicalLocales(locale)[0];
4746
+ }
4747
+
4748
+ // node_modules/.aspect_rules_js/@formatjs+intl-localematcher@0.0.0/node_modules/@formatjs/intl-localematcher/lib/abstract/InsertUnicodeExtensionAndCanonicalize.js
4749
+ function InsertUnicodeExtensionAndCanonicalize(locale, attributes, keywords) {
4750
+ invariant2(locale.indexOf("-u-") === -1, "Expected locale to not have a Unicode locale extension");
4751
+ var extension = "-u";
4752
+ for (var _i = 0, attributes_1 = attributes; _i < attributes_1.length; _i++) {
4753
+ var attr = attributes_1[_i];
4754
+ extension += "-".concat(attr);
4755
+ }
4756
+ for (var _a = 0, keywords_1 = keywords; _a < keywords_1.length; _a++) {
4757
+ var kw = keywords_1[_a];
4758
+ var key = kw.key, value = kw.value;
4759
+ extension += "-".concat(key);
4760
+ if (value !== "") {
4761
+ extension += "-".concat(value);
4762
+ }
4763
+ }
4764
+ if (extension === "-u") {
4765
+ return CanonicalizeUnicodeLocaleId(locale);
4766
+ }
4767
+ var privateIndex = locale.indexOf("-x-");
4768
+ var newLocale;
4769
+ if (privateIndex === -1) {
4770
+ newLocale = locale + extension;
4771
+ } else {
4772
+ var preExtension = locale.slice(0, privateIndex);
4773
+ var postExtension = locale.slice(privateIndex);
4774
+ newLocale = preExtension + extension + postExtension;
4775
+ }
4776
+ return CanonicalizeUnicodeLocaleId(newLocale);
4777
+ }
4778
+
4735
4779
  // node_modules/.aspect_rules_js/@formatjs+intl-localematcher@0.0.0/node_modules/@formatjs/intl-localematcher/lib/abstract/BestAvailableLocale.js
4736
4780
  function BestAvailableLocale(availableLocales, locale) {
4737
4781
  var candidate = locale;
@@ -4769,47 +4813,50 @@
4769
4813
  return result;
4770
4814
  }
4771
4815
 
4772
- // node_modules/.aspect_rules_js/@formatjs+intl-localematcher@0.0.0/node_modules/@formatjs/intl-localematcher/lib/abstract/UnicodeExtensionValue.js
4773
- function UnicodeExtensionValue(extension, key) {
4774
- invariant2(key.length === 2, "key must have 2 elements");
4816
+ // node_modules/.aspect_rules_js/@formatjs+intl-localematcher@0.0.0/node_modules/@formatjs/intl-localematcher/lib/abstract/UnicodeExtensionComponents.js
4817
+ function UnicodeExtensionComponents(extension) {
4818
+ invariant2(extension === extension.toLowerCase(), "Expected extension to be lowercase");
4819
+ invariant2(extension.slice(0, 3) === "-u-", "Expected extension to be a Unicode locale extension");
4820
+ var attributes = [];
4821
+ var keywords = [];
4822
+ var keyword;
4775
4823
  var size = extension.length;
4776
- var searchValue = "-".concat(key, "-");
4777
- var pos = extension.indexOf(searchValue);
4778
- if (pos !== -1) {
4779
- var start = pos + 4;
4780
- var end = start;
4781
- var k = start;
4782
- var done = false;
4783
- while (!done) {
4784
- var e = extension.indexOf("-", k);
4785
- var len = void 0;
4786
- if (e === -1) {
4787
- len = size - k;
4788
- } else {
4789
- len = e - k;
4824
+ var k = 3;
4825
+ while (k < size) {
4826
+ var e = extension.indexOf("-", k);
4827
+ var len = void 0;
4828
+ if (e === -1) {
4829
+ len = size - k;
4830
+ } else {
4831
+ len = e - k;
4832
+ }
4833
+ var subtag = extension.slice(k, k + len);
4834
+ invariant2(len >= 2, "Expected a subtag to have at least 2 characters");
4835
+ if (keyword === void 0 && len != 2) {
4836
+ if (attributes.indexOf(subtag) === -1) {
4837
+ attributes.push(subtag);
4790
4838
  }
4791
- if (len === 2) {
4792
- done = true;
4793
- } else if (e === -1) {
4794
- end = size;
4795
- done = true;
4796
- } else {
4797
- end = e;
4798
- k = e + 1;
4839
+ } else if (len === 2) {
4840
+ keyword = { key: subtag, value: "" };
4841
+ if (keywords.find(function(k2) {
4842
+ return k2.key === (keyword === null || keyword === void 0 ? void 0 : keyword.key);
4843
+ }) === void 0) {
4844
+ keywords.push(keyword);
4799
4845
  }
4846
+ } else if ((keyword === null || keyword === void 0 ? void 0 : keyword.value) === "") {
4847
+ keyword.value = subtag;
4848
+ } else {
4849
+ invariant2(keyword !== void 0, "Expected keyword to be defined");
4850
+ keyword.value += "-" + subtag;
4800
4851
  }
4801
- return extension.slice(start, end);
4802
- }
4803
- searchValue = "-".concat(key);
4804
- pos = extension.indexOf(searchValue);
4805
- if (pos !== -1 && pos + 3 === size) {
4806
- return "";
4852
+ k += len + 1;
4807
4853
  }
4808
- return void 0;
4854
+ return { attributes, keywords };
4809
4855
  }
4810
4856
 
4811
4857
  // node_modules/.aspect_rules_js/@formatjs+intl-localematcher@0.0.0/node_modules/@formatjs/intl-localematcher/lib/abstract/ResolveLocale.js
4812
4858
  function ResolveLocale(availableLocales, requestedLocales, options, relevantExtensionKeys, localeData, getDefaultLocale) {
4859
+ var _a;
4813
4860
  var matcher = options.localeMatcher;
4814
4861
  var r;
4815
4862
  if (matcher === "lookup") {
@@ -4817,56 +4864,77 @@
4817
4864
  } else {
4818
4865
  r = BestFitMatcher(Array.from(availableLocales), requestedLocales, getDefaultLocale);
4819
4866
  }
4867
+ if (r == null) {
4868
+ r = {
4869
+ locale: getDefaultLocale(),
4870
+ extension: ""
4871
+ };
4872
+ }
4820
4873
  var foundLocale = r.locale;
4821
- var result = { locale: "", dataLocale: foundLocale };
4822
- var supportedExtension = "-u";
4823
- for (var _i = 0, relevantExtensionKeys_1 = relevantExtensionKeys; _i < relevantExtensionKeys_1.length; _i++) {
4824
- var key = relevantExtensionKeys_1[_i];
4825
- invariant2(foundLocale in localeData, "Missing locale data for ".concat(foundLocale));
4826
- var foundLocaleData = localeData[foundLocale];
4827
- invariant2(typeof foundLocaleData === "object" && foundLocaleData !== null, "locale data ".concat(key, " must be an object"));
4828
- var keyLocaleData = foundLocaleData[key];
4829
- invariant2(Array.isArray(keyLocaleData), "keyLocaleData for ".concat(key, " must be an array"));
4874
+ var foundLocaleData = localeData[foundLocale];
4875
+ var result = { locale: "en", dataLocale: foundLocale };
4876
+ var components;
4877
+ var keywords;
4878
+ if (r.extension) {
4879
+ components = UnicodeExtensionComponents(r.extension);
4880
+ keywords = components.keywords;
4881
+ } else {
4882
+ keywords = [];
4883
+ }
4884
+ var supportedKeywords = [];
4885
+ var _loop_1 = function(key2) {
4886
+ var keyLocaleData = (_a = foundLocaleData === null || foundLocaleData === void 0 ? void 0 : foundLocaleData[key2]) !== null && _a !== void 0 ? _a : [];
4887
+ invariant2(Array.isArray(keyLocaleData), "keyLocaleData for ".concat(key2, " must be an array"));
4830
4888
  var value = keyLocaleData[0];
4831
- invariant2(typeof value === "string" || value === null, "value must be string or null but got ".concat(typeof value, " in key ").concat(key));
4832
- var supportedExtensionAddition = "";
4833
- if (r.extension) {
4834
- var requestedValue = UnicodeExtensionValue(r.extension, key);
4835
- if (requestedValue !== void 0) {
4836
- if (requestedValue !== "") {
4837
- if (~keyLocaleData.indexOf(requestedValue)) {
4838
- value = requestedValue;
4839
- supportedExtensionAddition = "-".concat(key, "-").concat(value);
4840
- }
4841
- } else if (~requestedValue.indexOf("true")) {
4842
- value = "true";
4843
- supportedExtensionAddition = "-".concat(key);
4889
+ invariant2(value === void 0 || typeof value === "string", "value must be a string or undefined");
4890
+ var supportedKeyword = void 0;
4891
+ var entry = keywords.find(function(k) {
4892
+ return k.key === key2;
4893
+ });
4894
+ if (entry) {
4895
+ var requestedValue = entry.value;
4896
+ if (requestedValue !== "") {
4897
+ if (keyLocaleData.indexOf(requestedValue) > -1) {
4898
+ value = requestedValue;
4899
+ supportedKeyword = {
4900
+ key: key2,
4901
+ value
4902
+ };
4844
4903
  }
4904
+ } else if (keyLocaleData.indexOf("true") > -1) {
4905
+ value = "true";
4906
+ supportedKeyword = {
4907
+ key: key2,
4908
+ value
4909
+ };
4845
4910
  }
4846
4911
  }
4847
- if (key in options) {
4848
- var optionsValue = options[key];
4849
- invariant2(typeof optionsValue === "string" || typeof optionsValue === "undefined" || optionsValue === null, "optionsValue must be String, Undefined or Null");
4850
- if (~keyLocaleData.indexOf(optionsValue)) {
4851
- if (optionsValue !== value) {
4852
- value = optionsValue;
4853
- supportedExtensionAddition = "";
4854
- }
4912
+ var optionsValue = options[key2];
4913
+ invariant2(optionsValue == null || typeof optionsValue === "string", "optionsValue must be a string or undefined");
4914
+ if (typeof optionsValue === "string") {
4915
+ var ukey = key2.toLowerCase();
4916
+ optionsValue = CanonicalizeUValue(ukey, optionsValue);
4917
+ if (optionsValue === "") {
4918
+ optionsValue = "true";
4855
4919
  }
4856
4920
  }
4857
- result[key] = value;
4858
- supportedExtension += supportedExtensionAddition;
4859
- }
4860
- if (supportedExtension.length > 2) {
4861
- var privateIndex = foundLocale.indexOf("-x-");
4862
- if (privateIndex === -1) {
4863
- foundLocale = foundLocale + supportedExtension;
4864
- } else {
4865
- var preExtension = foundLocale.slice(0, privateIndex);
4866
- var postExtension = foundLocale.slice(privateIndex, foundLocale.length);
4867
- foundLocale = preExtension + supportedExtension + postExtension;
4921
+ if (optionsValue !== value && keyLocaleData.indexOf(optionsValue) > -1) {
4922
+ value = optionsValue;
4923
+ supportedKeyword = void 0;
4924
+ }
4925
+ if (supportedKeyword) {
4926
+ supportedKeywords.push(supportedKeyword);
4868
4927
  }
4869
- foundLocale = Intl.getCanonicalLocales(foundLocale)[0];
4928
+ result[key2] = value;
4929
+ };
4930
+ for (var _i = 0, relevantExtensionKeys_1 = relevantExtensionKeys; _i < relevantExtensionKeys_1.length; _i++) {
4931
+ var key = relevantExtensionKeys_1[_i];
4932
+ _loop_1(key);
4933
+ }
4934
+ var supportedAttributes = [];
4935
+ if (supportedKeywords.length > 0) {
4936
+ supportedAttributes = [];
4937
+ foundLocale = InsertUnicodeExtensionAndCanonicalize(foundLocale, supportedAttributes, supportedKeywords);
4870
4938
  }
4871
4939
  result.locale = foundLocale;
4872
4940
  return result;
package/polyfill.js CHANGED
@@ -37,4 +37,3 @@ if ((0, should_polyfill_1.shouldPolyfill)()) {
37
37
  },
38
38
  });
39
39
  }
40
- //# sourceMappingURL=polyfill.js.map
@@ -62,4 +62,3 @@ function shouldPolyfill(locale) {
62
62
  return locale ? (0, intl_localematcher_1.match)([locale], supported_locales_generated_1.supportedLocales, 'en') : undefined;
63
63
  }
64
64
  }
65
- //# sourceMappingURL=should-polyfill.js.map
@@ -107,4 +107,3 @@ function BasicFormatMatcher(options, formats) {
107
107
  }
108
108
  return tslib_1.__assign({}, bestFormat);
109
109
  }
110
- //# sourceMappingURL=BasicFormatMatcher.js.map
@@ -118,4 +118,3 @@ function BestFitFormatMatcher(options, formats) {
118
118
  patternFormat.rangePatterns12 = skeletonFormat.rangePatterns12;
119
119
  return patternFormat;
120
120
  }
121
- //# sourceMappingURL=BestFitFormatMatcher.js.map
@@ -51,4 +51,3 @@ function DateTimeStyleFormat(dateStyle, timeStyle, dataLocaleData) {
51
51
  (0, ecma402_abstract_1.invariant)(dateStyle !== undefined, 'dateStyle should not be undefined');
52
52
  return dateFormat;
53
53
  }
54
- //# sourceMappingURL=DateTimeStyleFormat.js.map
@@ -16,4 +16,3 @@ function FormatDateTime(dtf, x, implDetails) {
16
16
  }
17
17
  return result;
18
18
  }
19
- //# sourceMappingURL=FormatDateTime.js.map
@@ -187,4 +187,3 @@ function FormatDateTimePattern(dtf, patternParts, x, _a) {
187
187
  }
188
188
  return result;
189
189
  }
190
- //# sourceMappingURL=FormatDateTimePattern.js.map
@@ -11,4 +11,3 @@ function FormatDateTimeRange(dtf, x, y, implDetails) {
11
11
  }
12
12
  return result;
13
13
  }
14
- //# sourceMappingURL=FormatDateTimeRange.js.map
@@ -15,4 +15,3 @@ function FormatDateTimeRangeToParts(dtf, x, y, implDetails) {
15
15
  }
16
16
  return result;
17
17
  }
18
- //# sourceMappingURL=FormatDateTimeRangeToParts.js.map
@@ -22,4 +22,3 @@ function FormatDateTimeToParts(dtf, x, implDetails) {
22
22
  }
23
23
  return result;
24
24
  }
25
- //# sourceMappingURL=FormatDateTimeToParts.js.map
@@ -191,4 +191,3 @@ function InitializeDateTimeFormat(dtf, locales, opts, _a) {
191
191
  internalSlots.rangePatterns = rangePatterns;
192
192
  return dtf; // TODO: remove this when https://github.com/microsoft/TypeScript/pull/50402 is merged
193
193
  }
194
- //# sourceMappingURL=InitializeDateTimeFormat.js.map
@@ -20,4 +20,3 @@ function PartitionDateTimePattern(dtf, x, implDetails) {
20
20
  var pattern = internalSlots.pattern;
21
21
  return (0, FormatDateTimePattern_1.FormatDateTimePattern)(dtf, (0, ecma402_abstract_1.PartitionPattern)(pattern), x, implDetails);
22
22
  }
23
- //# sourceMappingURL=PartitionDateTimePattern.js.map
@@ -120,4 +120,3 @@ function PartitionDateTimeRangePattern(dtf, x, y, implDetails) {
120
120
  }
121
121
  return result;
122
122
  }
123
- //# sourceMappingURL=PartitionDateTimeRangePattern.js.map
@@ -64,4 +64,3 @@ function ToDateTimeOptions(options, required, defaults) {
64
64
  }
65
65
  return options;
66
66
  }
67
- //# sourceMappingURL=ToDateTimeOptions.js.map
@@ -51,4 +51,3 @@ function ToLocalTime(t, calendar, timeZone, _a) {
51
51
  timeZoneOffset: timeZoneOffset,
52
52
  };
53
53
  }
54
- //# sourceMappingURL=ToLocalTime.js.map
@@ -298,4 +298,3 @@ function splitRangePattern(pattern) {
298
298
  },
299
299
  ];
300
300
  }
301
- //# sourceMappingURL=skeleton.js.map
@@ -22,4 +22,3 @@ exports.longMorePenalty = 6;
22
22
  exports.shortLessPenalty = 6;
23
23
  exports.shortMorePenalty = 3;
24
24
  exports.offsetPenalty = 1;
25
- //# sourceMappingURL=utils.js.map
package/src/core.js CHANGED
@@ -311,4 +311,3 @@ try {
311
311
  catch (e) {
312
312
  // Meta fix so we're test262-compliant, not important
313
313
  }
314
- //# sourceMappingURL=core.js.map
@@ -460,4 +460,3 @@ exports.default = {
460
460
  "Pacific/Wallis|,0,372,0|-100f9dh,0,372,0|-100f9dg,99,192,0|NaN,99,192,0"
461
461
  ]
462
462
  };
463
- //# sourceMappingURL=all-tz.js.map
package/src/data/links.js CHANGED
@@ -260,4 +260,3 @@ exports.default = {
260
260
  "WET": "Europe/Lisbon",
261
261
  "Zulu": "Etc/UTC"
262
262
  };
263
- //# sourceMappingURL=links.js.map
@@ -12,4 +12,3 @@ function getInternalSlots(x) {
12
12
  }
13
13
  return internalSlots;
14
14
  }
15
- //# sourceMappingURL=get_internal_slots.js.map
package/src/packer.js CHANGED
@@ -41,4 +41,3 @@ function unpack(data) {
41
41
  }
42
42
  return zones;
43
43
  }
44
- //# sourceMappingURL=packer.js.map
@@ -22,4 +22,3 @@ function toLocaleTimeString(x, locales, options) {
22
22
  var dtf = new core_1.DateTimeFormat(locales, (0, ToDateTimeOptions_1.ToDateTimeOptions)(options, 'time', 'time'));
23
23
  return dtf.format(x);
24
24
  }
25
- //# sourceMappingURL=to_locale_string.js.map
package/src/types.js CHANGED
@@ -1,3 +1,2 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- //# sourceMappingURL=types.js.map
@@ -2,4 +2,3 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.supportedLocales = void 0;
4
4
  exports.supportedLocales = ["af", "af-NA", "agq", "ak", "am", "ar", "ar-AE", "ar-BH", "ar-DJ", "ar-DZ", "ar-EG", "ar-EH", "ar-ER", "ar-IL", "ar-IQ", "ar-JO", "ar-KM", "ar-KW", "ar-LB", "ar-LY", "ar-MA", "ar-MR", "ar-OM", "ar-PS", "ar-QA", "ar-SA", "ar-SD", "ar-SO", "ar-SS", "ar-SY", "ar-TD", "ar-TN", "ar-YE", "as", "asa", "ast", "az", "az-Cyrl", "az-Latn", "bas", "be", "be-tarask", "bem", "bez", "bg", "bm", "bn", "bn-IN", "bo", "bo-IN", "br", "brx", "bs", "bs-Cyrl", "bs-Latn", "ca", "ca-AD", "ca-ES-valencia", "ca-FR", "ca-IT", "ccp", "ccp-IN", "ce", "ceb", "cgg", "chr", "ckb", "ckb-IR", "cs", "cy", "da", "da-GL", "dav", "de", "de-AT", "de-BE", "de-CH", "de-IT", "de-LI", "de-LU", "dje", "doi", "dsb", "dua", "dyo", "dz", "ebu", "ee", "ee-TG", "el", "el-CY", "en", "en-001", "en-150", "en-AE", "en-AG", "en-AI", "en-AS", "en-AT", "en-AU", "en-BB", "en-BE", "en-BI", "en-BM", "en-BS", "en-BW", "en-BZ", "en-CA", "en-CC", "en-CH", "en-CK", "en-CM", "en-CX", "en-CY", "en-DE", "en-DG", "en-DK", "en-DM", "en-ER", "en-FI", "en-FJ", "en-FK", "en-FM", "en-GB", "en-GD", "en-GG", "en-GH", "en-GI", "en-GM", "en-GU", "en-GY", "en-HK", "en-IE", "en-IL", "en-IM", "en-IN", "en-IO", "en-JE", "en-JM", "en-KE", "en-KI", "en-KN", "en-KY", "en-LC", "en-LR", "en-LS", "en-MG", "en-MH", "en-MO", "en-MP", "en-MS", "en-MT", "en-MU", "en-MW", "en-MY", "en-NA", "en-NF", "en-NG", "en-NL", "en-NR", "en-NU", "en-NZ", "en-PG", "en-PH", "en-PK", "en-PN", "en-PR", "en-PW", "en-RW", "en-SB", "en-SC", "en-SD", "en-SE", "en-SG", "en-SH", "en-SI", "en-SL", "en-SS", "en-SX", "en-SZ", "en-TC", "en-TK", "en-TO", "en-TT", "en-TV", "en-TZ", "en-UG", "en-UM", "en-VC", "en-VG", "en-VI", "en-VU", "en-WS", "en-ZA", "en-ZM", "en-ZW", "eo", "es", "es-419", "es-AR", "es-BO", "es-BR", "es-BZ", "es-CL", "es-CO", "es-CR", "es-CU", "es-DO", "es-EA", "es-EC", "es-GQ", "es-GT", "es-HN", "es-IC", "es-MX", "es-NI", "es-PA", "es-PE", "es-PH", "es-PR", "es-PY", "es-SV", "es-US", "es-UY", "es-VE", "et", "eu", "ewo", "fa", "fa-AF", "ff", "ff-Adlm", "ff-Adlm-BF", "ff-Adlm-CM", "ff-Adlm-GH", "ff-Adlm-GM", "ff-Adlm-GW", "ff-Adlm-LR", "ff-Adlm-MR", "ff-Adlm-NE", "ff-Adlm-NG", "ff-Adlm-SL", "ff-Adlm-SN", "ff-Latn", "ff-Latn-BF", "ff-Latn-CM", "ff-Latn-GH", "ff-Latn-GM", "ff-Latn-GN", "ff-Latn-GW", "ff-Latn-LR", "ff-Latn-MR", "ff-Latn-NE", "ff-Latn-NG", "ff-Latn-SL", "fi", "fil", "fo", "fo-DK", "fr", "fr-BE", "fr-BF", "fr-BI", "fr-BJ", "fr-BL", "fr-CA", "fr-CD", "fr-CF", "fr-CG", "fr-CH", "fr-CI", "fr-CM", "fr-DJ", "fr-DZ", "fr-GA", "fr-GF", "fr-GN", "fr-GP", "fr-GQ", "fr-HT", "fr-KM", "fr-LU", "fr-MA", "fr-MC", "fr-MF", "fr-MG", "fr-ML", "fr-MQ", "fr-MR", "fr-MU", "fr-NC", "fr-NE", "fr-PF", "fr-PM", "fr-RE", "fr-RW", "fr-SC", "fr-SN", "fr-SY", "fr-TD", "fr-TG", "fr-TN", "fr-VU", "fr-WF", "fr-YT", "fur", "fy", "ga", "ga-GB", "gd", "gl", "gsw", "gsw-FR", "gsw-LI", "gu", "guz", "gv", "ha", "ha-GH", "ha-NE", "haw", "he", "hi", "hr", "hr-BA", "hsb", "hu", "hy", "ia", "id", "ig", "ii", "is", "it", "it-CH", "it-SM", "it-VA", "ja", "jgo", "jmc", "jv", "ka", "kab", "kam", "kde", "kea", "kgp", "khq", "ki", "kk", "kkj", "kl", "kln", "km", "kn", "ko", "ko-KP", "kok", "ks", "ks-Arab", "ksb", "ksf", "ksh", "ku", "kw", "ky", "lag", "lb", "lg", "lkt", "ln", "ln-AO", "ln-CF", "ln-CG", "lo", "lrc", "lrc-IQ", "lt", "lu", "luo", "luy", "lv", "mai", "mas", "mas-TZ", "mer", "mfe", "mg", "mgh", "mgo", "mi", "mk", "ml", "mn", "mni", "mni-Beng", "mr", "ms", "ms-BN", "ms-ID", "ms-SG", "mt", "mua", "my", "mzn", "naq", "nb", "nb-SJ", "nd", "nds", "nds-NL", "ne", "ne-IN", "nl", "nl-AW", "nl-BE", "nl-BQ", "nl-CW", "nl-SR", "nl-SX", "nmg", "nn", "nnh", "no", "nus", "nyn", "om", "om-KE", "or", "os", "os-RU", "pa", "pa-Arab", "pa-Guru", "pcm", "pl", "ps", "ps-PK", "pt", "pt-AO", "pt-CH", "pt-CV", "pt-GQ", "pt-GW", "pt-LU", "pt-MO", "pt-MZ", "pt-PT", "pt-ST", "pt-TL", "qu", "qu-BO", "qu-EC", "rm", "rn", "ro", "ro-MD", "rof", "ru", "ru-BY", "ru-KG", "ru-KZ", "ru-MD", "ru-UA", "rw", "rwk", "sa", "sah", "saq", "sat", "sat-Olck", "sbp", "sc", "sd", "sd-Arab", "sd-Deva", "se", "se-FI", "se-SE", "seh", "ses", "sg", "shi", "shi-Latn", "shi-Tfng", "si", "sk", "sl", "smn", "sn", "so", "so-DJ", "so-ET", "so-KE", "sq", "sq-MK", "sq-XK", "sr", "sr-Cyrl", "sr-Cyrl-BA", "sr-Cyrl-ME", "sr-Cyrl-XK", "sr-Latn", "sr-Latn-BA", "sr-Latn-ME", "sr-Latn-XK", "su", "su-Latn", "sv", "sv-AX", "sv-FI", "sw", "sw-CD", "sw-KE", "sw-UG", "ta", "ta-LK", "ta-MY", "ta-SG", "te", "teo", "teo-KE", "tg", "th", "ti", "ti-ER", "tk", "to", "tr", "tr-CY", "tt", "twq", "tzm", "ug", "uk", "und", "ur", "ur-IN", "uz", "uz-Arab", "uz-Cyrl", "uz-Latn", "vai", "vai-Latn", "vai-Vaii", "vi", "vun", "wae", "wo", "xh", "xog", "yav", "yi", "yo", "yo-BJ", "yrl", "yrl-CO", "yrl-VE", "yue", "yue-Hans", "yue-Hant", "zgh", "zh", "zh-Hans", "zh-Hans-HK", "zh-Hans-MO", "zh-Hans-SG", "zh-Hant", "zh-Hant-HK", "zh-Hant-MO", "zu"];
5
- //# sourceMappingURL=supported-locales.generated.js.map
package/test262-main.js CHANGED
@@ -23787,4 +23787,3 @@ Intl.DateTimeFormat.__addLocaleData({
23787
23787
  "locale": "zh"
23788
23788
  });
23789
23789
  Intl.DateTimeFormat.__addTZData(all_tz_1.default);
23790
- //# sourceMappingURL=test262-main.js.map