@formatjs/intl-datetimeformat 6.18.2 → 7.0.1

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 (98) hide show
  1. package/index.d.ts +1 -1
  2. package/index.js +1 -4
  3. package/package.json +14 -6
  4. package/polyfill-force.js +13 -15
  5. package/polyfill.iife.js +44 -44
  6. package/polyfill.js +15 -17
  7. package/should-polyfill.js +7 -10
  8. package/src/abstract/BasicFormatMatcher.js +26 -29
  9. package/src/abstract/BestFitFormatMatcher.js +19 -23
  10. package/src/abstract/DateTimeStyleFormat.js +5 -8
  11. package/src/abstract/FormatDateTime.d.ts +1 -1
  12. package/src/abstract/FormatDateTime.js +3 -6
  13. package/src/abstract/FormatDateTimePattern.d.ts +1 -1
  14. package/src/abstract/FormatDateTimePattern.js +12 -16
  15. package/src/abstract/FormatDateTimeRange.d.ts +2 -2
  16. package/src/abstract/FormatDateTimeRange.js +3 -6
  17. package/src/abstract/FormatDateTimeRangeToParts.d.ts +2 -2
  18. package/src/abstract/FormatDateTimeRangeToParts.js +4 -7
  19. package/src/abstract/FormatDateTimeToParts.d.ts +1 -1
  20. package/src/abstract/FormatDateTimeToParts.js +5 -8
  21. package/src/abstract/InitializeDateTimeFormat.js +37 -40
  22. package/src/abstract/PartitionDateTimePattern.d.ts +2 -2
  23. package/src/abstract/PartitionDateTimePattern.js +6 -9
  24. package/src/abstract/PartitionDateTimeRangePattern.d.ts +2 -2
  25. package/src/abstract/PartitionDateTimeRangePattern.js +16 -19
  26. package/src/abstract/ToDateTimeOptions.js +3 -6
  27. package/src/abstract/ToLocalTime.js +11 -14
  28. package/src/abstract/skeleton.js +14 -20
  29. package/src/abstract/utils.js +9 -12
  30. package/src/core.d.ts +1 -1
  31. package/src/core.js +115 -116
  32. package/src/data/all-tz.js +1 -3
  33. package/src/data/links.js +1 -3
  34. package/src/get_internal_slots.js +1 -4
  35. package/src/packer.d.ts +1 -1
  36. package/src/packer.js +5 -9
  37. package/src/to_locale_string.js +8 -13
  38. package/src/types.d.ts +1 -1
  39. package/src/types.js +1 -2
  40. package/supported-locales.generated.js +1 -4
  41. package/test262-main.d.ts +1 -1
  42. package/test262-main.js +3 -6
  43. package/lib/index.d.ts +0 -1
  44. package/lib/index.js +0 -1
  45. package/lib/polyfill-force.d.ts +0 -1
  46. package/lib/polyfill-force.js +0 -44
  47. package/lib/polyfill.d.ts +0 -1
  48. package/lib/polyfill.js +0 -47
  49. package/lib/should-polyfill.d.ts +0 -1
  50. package/lib/should-polyfill.js +0 -61
  51. package/lib/src/abstract/BasicFormatMatcher.d.ts +0 -7
  52. package/lib/src/abstract/BasicFormatMatcher.js +0 -106
  53. package/lib/src/abstract/BestFitFormatMatcher.d.ts +0 -16
  54. package/lib/src/abstract/BestFitFormatMatcher.js +0 -116
  55. package/lib/src/abstract/DateTimeStyleFormat.d.ts +0 -2
  56. package/lib/src/abstract/DateTimeStyleFormat.js +0 -50
  57. package/lib/src/abstract/FormatDateTime.d.ts +0 -9
  58. package/lib/src/abstract/FormatDateTime.js +0 -15
  59. package/lib/src/abstract/FormatDateTimePattern.d.ts +0 -14
  60. package/lib/src/abstract/FormatDateTimePattern.js +0 -191
  61. package/lib/src/abstract/FormatDateTimeRange.d.ts +0 -4
  62. package/lib/src/abstract/FormatDateTimeRange.js +0 -10
  63. package/lib/src/abstract/FormatDateTimeRangeToParts.d.ts +0 -5
  64. package/lib/src/abstract/FormatDateTimeRangeToParts.js +0 -14
  65. package/lib/src/abstract/FormatDateTimeToParts.d.ts +0 -11
  66. package/lib/src/abstract/FormatDateTimeToParts.js +0 -21
  67. package/lib/src/abstract/InitializeDateTimeFormat.d.ts +0 -17
  68. package/lib/src/abstract/InitializeDateTimeFormat.js +0 -190
  69. package/lib/src/abstract/PartitionDateTimePattern.d.ts +0 -10
  70. package/lib/src/abstract/PartitionDateTimePattern.js +0 -17
  71. package/lib/src/abstract/PartitionDateTimeRangePattern.d.ts +0 -5
  72. package/lib/src/abstract/PartitionDateTimeRangePattern.js +0 -119
  73. package/lib/src/abstract/ToDateTimeOptions.d.ts +0 -7
  74. package/lib/src/abstract/ToDateTimeOptions.js +0 -63
  75. package/lib/src/abstract/ToLocalTime.d.ts +0 -26
  76. package/lib/src/abstract/ToLocalTime.js +0 -49
  77. package/lib/src/abstract/skeleton.d.ts +0 -13
  78. package/lib/src/abstract/skeleton.js +0 -294
  79. package/lib/src/abstract/utils.d.ts +0 -10
  80. package/lib/src/abstract/utils.js +0 -21
  81. package/lib/src/core.d.ts +0 -20
  82. package/lib/src/core.js +0 -300
  83. package/lib/src/data/all-tz.d.ts +0 -6
  84. package/lib/src/data/all-tz.js +0 -461
  85. package/lib/src/data/links.d.ts +0 -259
  86. package/lib/src/data/links.js +0 -260
  87. package/lib/src/get_internal_slots.d.ts +0 -2
  88. package/lib/src/get_internal_slots.js +0 -11
  89. package/lib/src/packer.d.ts +0 -4
  90. package/lib/src/packer.js +0 -39
  91. package/lib/src/to_locale_string.d.ts +0 -7
  92. package/lib/src/to_locale_string.js +0 -19
  93. package/lib/src/types.d.ts +0 -47
  94. package/lib/src/types.js +0 -1
  95. package/lib/supported-locales.generated.d.ts +0 -1
  96. package/lib/supported-locales.generated.js +0 -1
  97. package/lib/test262-main.d.ts +0 -1
  98. package/lib/test262-main.js +0 -23786
package/src/core.js CHANGED
@@ -1,21 +1,18 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.DateTimeFormat = void 0;
4
- var tslib_1 = require("tslib");
5
- var ecma402_abstract_1 = require("@formatjs/ecma402-abstract");
6
- var decimal_js_1 = tslib_1.__importDefault(require("decimal.js"));
7
- var FormatDateTime_1 = require("./abstract/FormatDateTime");
8
- var FormatDateTimeRange_1 = require("./abstract/FormatDateTimeRange");
9
- var FormatDateTimeRangeToParts_1 = require("./abstract/FormatDateTimeRangeToParts");
10
- var FormatDateTimeToParts_1 = require("./abstract/FormatDateTimeToParts");
11
- var InitializeDateTimeFormat_1 = require("./abstract/InitializeDateTimeFormat");
12
- var skeleton_1 = require("./abstract/skeleton");
13
- var utils_1 = require("./abstract/utils");
14
- var links_1 = tslib_1.__importDefault(require("./data/links"));
15
- var get_internal_slots_1 = tslib_1.__importDefault(require("./get_internal_slots"));
16
- var packer_1 = require("./packer");
17
- var UPPERCASED_LINKS = Object.keys(links_1.default).reduce(function (all, l) {
18
- all[l.toUpperCase()] = links_1.default[l];
1
+ import { __assign, __rest } from "tslib";
2
+ import { CanonicalizeLocaleList, CanonicalizeTimeZoneName, IsValidTimeZoneName, OrdinaryHasInstance, SupportedLocales, ToNumber, defineProperty, invariant, } from '@formatjs/ecma402-abstract';
3
+ import Decimal from 'decimal.js';
4
+ import { FormatDateTime } from './abstract/FormatDateTime.js';
5
+ import { FormatDateTimeRange } from './abstract/FormatDateTimeRange.js';
6
+ import { FormatDateTimeRangeToParts } from './abstract/FormatDateTimeRangeToParts.js';
7
+ import { FormatDateTimeToParts } from './abstract/FormatDateTimeToParts.js';
8
+ import { InitializeDateTimeFormat } from './abstract/InitializeDateTimeFormat.js';
9
+ import { parseDateTimeSkeleton } from './abstract/skeleton.js';
10
+ import { DATE_TIME_PROPS } from './abstract/utils.js';
11
+ import links from './data/links.js';
12
+ import getInternalSlots from './get_internal_slots.js';
13
+ import { unpack } from './packer.js';
14
+ var UPPERCASED_LINKS = Object.keys(links).reduce(function (all, l) {
15
+ all[l.toUpperCase()] = links[l];
19
16
  return all;
20
17
  }, {});
21
18
  var RESOLVED_OPTIONS_KEYS = [
@@ -41,10 +38,10 @@ var formatDescriptor = {
41
38
  configurable: true,
42
39
  get: function () {
43
40
  if (typeof this !== 'object' ||
44
- !(0, ecma402_abstract_1.OrdinaryHasInstance)(exports.DateTimeFormat, this)) {
41
+ !OrdinaryHasInstance(DateTimeFormat, this)) {
45
42
  throw TypeError('Intl.DateTimeFormat format property accessor called on incompatible receiver');
46
43
  }
47
- var internalSlots = (0, get_internal_slots_1.default)(this);
44
+ var internalSlots = getInternalSlots(this);
48
45
  // eslint-disable-next-line @typescript-eslint/no-this-alias
49
46
  var dtf = this;
50
47
  var boundFormat = internalSlots.boundFormat;
@@ -53,16 +50,16 @@ var formatDescriptor = {
53
50
  boundFormat = function (date) {
54
51
  var x;
55
52
  if (date === undefined) {
56
- x = new decimal_js_1.default(Date.now());
53
+ x = new Decimal(Date.now());
57
54
  }
58
55
  else {
59
- x = (0, ecma402_abstract_1.ToNumber)(date);
56
+ x = ToNumber(date);
60
57
  }
61
- return (0, FormatDateTime_1.FormatDateTime)(dtf, x, {
62
- getInternalSlots: get_internal_slots_1.default,
63
- localeData: exports.DateTimeFormat.localeData,
64
- tzData: exports.DateTimeFormat.tzData,
65
- getDefaultTimeZone: exports.DateTimeFormat.getDefaultTimeZone,
58
+ return FormatDateTime(dtf, x, {
59
+ getInternalSlots: getInternalSlots,
60
+ localeData: DateTimeFormat.localeData,
61
+ tzData: DateTimeFormat.tzData,
62
+ getDefaultTimeZone: DateTimeFormat.getDefaultTimeZone,
66
63
  });
67
64
  };
68
65
  try {
@@ -74,7 +71,7 @@ var formatDescriptor = {
74
71
  value: '',
75
72
  });
76
73
  }
77
- catch (e) {
74
+ catch (_a) {
78
75
  // In older browser (e.g Chrome 36 like polyfill-fastly.io)
79
76
  // TypeError: Cannot redefine property: name
80
77
  }
@@ -92,45 +89,45 @@ try {
92
89
  value: 'get format',
93
90
  });
94
91
  }
95
- catch (e) {
92
+ catch (_a) {
96
93
  // In older browser (e.g Chrome 36 like polyfill-fastly.io)
97
94
  // TypeError: Cannot redefine property: name
98
95
  }
99
- exports.DateTimeFormat = function (locales, options) {
96
+ export var DateTimeFormat = function (locales, options) {
100
97
  // Cannot use `new.target` bc of IE11 & TS transpiles it to something else
101
- if (!this || !(0, ecma402_abstract_1.OrdinaryHasInstance)(exports.DateTimeFormat, this)) {
102
- return new exports.DateTimeFormat(locales, options);
98
+ if (!this || !OrdinaryHasInstance(DateTimeFormat, this)) {
99
+ return new DateTimeFormat(locales, options);
103
100
  }
104
- (0, InitializeDateTimeFormat_1.InitializeDateTimeFormat)(this, locales, options, {
105
- tzData: exports.DateTimeFormat.tzData,
101
+ InitializeDateTimeFormat(this, locales, options, {
102
+ tzData: DateTimeFormat.tzData,
106
103
  uppercaseLinks: UPPERCASED_LINKS,
107
- availableLocales: exports.DateTimeFormat.availableLocales,
108
- relevantExtensionKeys: exports.DateTimeFormat.relevantExtensionKeys,
109
- getDefaultLocale: exports.DateTimeFormat.getDefaultLocale,
110
- getDefaultTimeZone: exports.DateTimeFormat.getDefaultTimeZone,
111
- getInternalSlots: get_internal_slots_1.default,
112
- localeData: exports.DateTimeFormat.localeData,
104
+ availableLocales: DateTimeFormat.availableLocales,
105
+ relevantExtensionKeys: DateTimeFormat.relevantExtensionKeys,
106
+ getDefaultLocale: DateTimeFormat.getDefaultLocale,
107
+ getDefaultTimeZone: DateTimeFormat.getDefaultTimeZone,
108
+ getInternalSlots: getInternalSlots,
109
+ localeData: DateTimeFormat.localeData,
113
110
  });
114
111
  /** IMPL START */
115
- var internalSlots = (0, get_internal_slots_1.default)(this);
112
+ var internalSlots = getInternalSlots(this);
116
113
  var dataLocale = internalSlots.dataLocale;
117
- var dataLocaleData = exports.DateTimeFormat.localeData[dataLocale];
118
- (0, ecma402_abstract_1.invariant)(dataLocaleData !== undefined, "Cannot load locale-dependent data for ".concat(dataLocale, "."));
114
+ var dataLocaleData = DateTimeFormat.localeData[dataLocale];
115
+ invariant(dataLocaleData !== undefined, "Cannot load locale-dependent data for ".concat(dataLocale, "."));
119
116
  /** IMPL END */
120
117
  };
121
118
  // Static properties
122
- (0, ecma402_abstract_1.defineProperty)(exports.DateTimeFormat, 'supportedLocalesOf', {
119
+ defineProperty(DateTimeFormat, 'supportedLocalesOf', {
123
120
  value: function supportedLocalesOf(locales, options) {
124
- return (0, ecma402_abstract_1.SupportedLocales)(exports.DateTimeFormat.availableLocales, (0, ecma402_abstract_1.CanonicalizeLocaleList)(locales), options);
121
+ return SupportedLocales(DateTimeFormat.availableLocales, CanonicalizeLocaleList(locales), options);
125
122
  },
126
123
  });
127
- (0, ecma402_abstract_1.defineProperty)(exports.DateTimeFormat.prototype, 'resolvedOptions', {
124
+ defineProperty(DateTimeFormat.prototype, 'resolvedOptions', {
128
125
  value: function resolvedOptions() {
129
126
  if (typeof this !== 'object' ||
130
- !(0, ecma402_abstract_1.OrdinaryHasInstance)(exports.DateTimeFormat, this)) {
127
+ !OrdinaryHasInstance(DateTimeFormat, this)) {
131
128
  throw TypeError('Method Intl.DateTimeFormat.prototype.resolvedOptions called on incompatible receiver');
132
129
  }
133
- var internalSlots = (0, get_internal_slots_1.default)(this);
130
+ var internalSlots = getInternalSlots(this);
134
131
  var ro = {};
135
132
  for (var _i = 0, RESOLVED_OPTIONS_KEYS_1 = RESOLVED_OPTIONS_KEYS; _i < RESOLVED_OPTIONS_KEYS_1.length; _i++) {
136
133
  var key = RESOLVED_OPTIONS_KEYS_1[_i];
@@ -145,7 +142,7 @@ exports.DateTimeFormat = function (locales, options) {
145
142
  ro.hour12 = hour12;
146
143
  }
147
144
  }
148
- if (utils_1.DATE_TIME_PROPS.indexOf(key) > -1) {
145
+ if (DATE_TIME_PROPS.indexOf(key) > -1) {
149
146
  if (internalSlots.dateStyle !== undefined ||
150
147
  internalSlots.timeStyle !== undefined) {
151
148
  value = undefined;
@@ -158,98 +155,100 @@ exports.DateTimeFormat = function (locales, options) {
158
155
  return ro;
159
156
  },
160
157
  });
161
- (0, ecma402_abstract_1.defineProperty)(exports.DateTimeFormat.prototype, 'formatToParts', {
158
+ defineProperty(DateTimeFormat.prototype, 'formatToParts', {
162
159
  value: function formatToParts(date) {
163
160
  var x;
164
161
  if (date === undefined) {
165
- x = new decimal_js_1.default(Date.now());
162
+ x = new Decimal(Date.now());
166
163
  }
167
164
  else {
168
- x = (0, ecma402_abstract_1.ToNumber)(date);
165
+ x = ToNumber(date);
169
166
  }
170
- return (0, FormatDateTimeToParts_1.FormatDateTimeToParts)(this, x, {
171
- getInternalSlots: get_internal_slots_1.default,
172
- localeData: exports.DateTimeFormat.localeData,
173
- tzData: exports.DateTimeFormat.tzData,
174
- getDefaultTimeZone: exports.DateTimeFormat.getDefaultTimeZone,
167
+ return FormatDateTimeToParts(this, x, {
168
+ getInternalSlots: getInternalSlots,
169
+ localeData: DateTimeFormat.localeData,
170
+ tzData: DateTimeFormat.tzData,
171
+ getDefaultTimeZone: DateTimeFormat.getDefaultTimeZone,
175
172
  });
176
173
  },
177
174
  });
178
- (0, ecma402_abstract_1.defineProperty)(exports.DateTimeFormat.prototype, 'formatRangeToParts', {
175
+ defineProperty(DateTimeFormat.prototype, 'formatRangeToParts', {
179
176
  value: function formatRangeToParts(startDate, endDate) {
177
+ // oxlint-disable-next-line no-this-alias
180
178
  var dtf = this;
181
- (0, ecma402_abstract_1.invariant)(typeof dtf === 'object', 'receiver is not an object', TypeError);
182
- (0, ecma402_abstract_1.invariant)(startDate !== undefined && endDate !== undefined, 'startDate/endDate cannot be undefined', TypeError);
183
- return (0, FormatDateTimeRangeToParts_1.FormatDateTimeRangeToParts)(dtf, (0, ecma402_abstract_1.ToNumber)(startDate), (0, ecma402_abstract_1.ToNumber)(endDate), {
184
- getInternalSlots: get_internal_slots_1.default,
185
- localeData: exports.DateTimeFormat.localeData,
186
- tzData: exports.DateTimeFormat.tzData,
187
- getDefaultTimeZone: exports.DateTimeFormat.getDefaultTimeZone,
179
+ invariant(typeof dtf === 'object', 'receiver is not an object', TypeError);
180
+ invariant(startDate !== undefined && endDate !== undefined, 'startDate/endDate cannot be undefined', TypeError);
181
+ return FormatDateTimeRangeToParts(dtf, ToNumber(startDate), ToNumber(endDate), {
182
+ getInternalSlots: getInternalSlots,
183
+ localeData: DateTimeFormat.localeData,
184
+ tzData: DateTimeFormat.tzData,
185
+ getDefaultTimeZone: DateTimeFormat.getDefaultTimeZone,
188
186
  });
189
187
  },
190
188
  });
191
- (0, ecma402_abstract_1.defineProperty)(exports.DateTimeFormat.prototype, 'formatRange', {
189
+ defineProperty(DateTimeFormat.prototype, 'formatRange', {
192
190
  value: function formatRange(startDate, endDate) {
191
+ // oxlint-disable-next-line no-this-alias
193
192
  var dtf = this;
194
- (0, ecma402_abstract_1.invariant)(typeof dtf === 'object', 'receiver is not an object', TypeError);
195
- (0, ecma402_abstract_1.invariant)(startDate !== undefined && endDate !== undefined, 'startDate/endDate cannot be undefined', TypeError);
196
- return (0, FormatDateTimeRange_1.FormatDateTimeRange)(dtf, (0, ecma402_abstract_1.ToNumber)(startDate), (0, ecma402_abstract_1.ToNumber)(endDate), {
197
- getInternalSlots: get_internal_slots_1.default,
198
- localeData: exports.DateTimeFormat.localeData,
199
- tzData: exports.DateTimeFormat.tzData,
200
- getDefaultTimeZone: exports.DateTimeFormat.getDefaultTimeZone,
193
+ invariant(typeof dtf === 'object', 'receiver is not an object', TypeError);
194
+ invariant(startDate !== undefined && endDate !== undefined, 'startDate/endDate cannot be undefined', TypeError);
195
+ return FormatDateTimeRange(dtf, ToNumber(startDate), ToNumber(endDate), {
196
+ getInternalSlots: getInternalSlots,
197
+ localeData: DateTimeFormat.localeData,
198
+ tzData: DateTimeFormat.tzData,
199
+ getDefaultTimeZone: DateTimeFormat.getDefaultTimeZone,
201
200
  });
202
201
  },
203
202
  });
204
203
  var DEFAULT_TIMEZONE = 'UTC';
205
- exports.DateTimeFormat.__setDefaultTimeZone = function (timeZone) {
204
+ DateTimeFormat.__setDefaultTimeZone = function (timeZone) {
206
205
  if (timeZone !== undefined) {
207
206
  timeZone = String(timeZone);
208
- if (!(0, ecma402_abstract_1.IsValidTimeZoneName)(timeZone, {
209
- zoneNamesFromData: Object.keys(exports.DateTimeFormat.tzData),
207
+ if (!IsValidTimeZoneName(timeZone, {
208
+ zoneNamesFromData: Object.keys(DateTimeFormat.tzData),
210
209
  uppercaseLinks: UPPERCASED_LINKS,
211
210
  })) {
212
211
  throw new RangeError('Invalid timeZoneName');
213
212
  }
214
- timeZone = (0, ecma402_abstract_1.CanonicalizeTimeZoneName)(timeZone, {
215
- zoneNames: Object.keys(exports.DateTimeFormat.tzData),
213
+ timeZone = CanonicalizeTimeZoneName(timeZone, {
214
+ zoneNames: Object.keys(DateTimeFormat.tzData),
216
215
  uppercaseLinks: UPPERCASED_LINKS,
217
216
  });
218
217
  }
219
218
  else {
220
219
  timeZone = DEFAULT_TIMEZONE;
221
220
  }
222
- exports.DateTimeFormat.__defaultTimeZone = timeZone;
221
+ DateTimeFormat.__defaultTimeZone = timeZone;
223
222
  };
224
- exports.DateTimeFormat.relevantExtensionKeys = ['nu', 'ca', 'hc'];
225
- exports.DateTimeFormat.__defaultTimeZone = DEFAULT_TIMEZONE;
226
- exports.DateTimeFormat.getDefaultTimeZone = function () { return exports.DateTimeFormat.__defaultTimeZone; };
227
- exports.DateTimeFormat.__addLocaleData = function __addLocaleData() {
223
+ DateTimeFormat.relevantExtensionKeys = ['nu', 'ca', 'hc'];
224
+ DateTimeFormat.__defaultTimeZone = DEFAULT_TIMEZONE;
225
+ DateTimeFormat.getDefaultTimeZone = function () { return DateTimeFormat.__defaultTimeZone; };
226
+ DateTimeFormat.__addLocaleData = function __addLocaleData() {
228
227
  var data = [];
229
228
  for (var _i = 0; _i < arguments.length; _i++) {
230
229
  data[_i] = arguments[_i];
231
230
  }
232
231
  var _loop_1 = function (d, locale) {
233
- var dateFormat = d.dateFormat, timeFormat = d.timeFormat, dateTimeFormat = d.dateTimeFormat, formats = d.formats, intervalFormats = d.intervalFormats, rawData = tslib_1.__rest(d, ["dateFormat", "timeFormat", "dateTimeFormat", "formats", "intervalFormats"]);
234
- var processedData = tslib_1.__assign(tslib_1.__assign({}, rawData), { dateFormat: {
235
- full: (0, skeleton_1.parseDateTimeSkeleton)(dateFormat.full),
236
- long: (0, skeleton_1.parseDateTimeSkeleton)(dateFormat.long),
237
- medium: (0, skeleton_1.parseDateTimeSkeleton)(dateFormat.medium),
238
- short: (0, skeleton_1.parseDateTimeSkeleton)(dateFormat.short),
232
+ var dateFormat = d.dateFormat, timeFormat = d.timeFormat, dateTimeFormat = d.dateTimeFormat, formats = d.formats, intervalFormats = d.intervalFormats, rawData = __rest(d, ["dateFormat", "timeFormat", "dateTimeFormat", "formats", "intervalFormats"]);
233
+ var processedData = __assign(__assign({}, rawData), { dateFormat: {
234
+ full: parseDateTimeSkeleton(dateFormat.full),
235
+ long: parseDateTimeSkeleton(dateFormat.long),
236
+ medium: parseDateTimeSkeleton(dateFormat.medium),
237
+ short: parseDateTimeSkeleton(dateFormat.short),
239
238
  }, timeFormat: {
240
- full: (0, skeleton_1.parseDateTimeSkeleton)(timeFormat.full),
241
- long: (0, skeleton_1.parseDateTimeSkeleton)(timeFormat.long),
242
- medium: (0, skeleton_1.parseDateTimeSkeleton)(timeFormat.medium),
243
- short: (0, skeleton_1.parseDateTimeSkeleton)(timeFormat.short),
239
+ full: parseDateTimeSkeleton(timeFormat.full),
240
+ long: parseDateTimeSkeleton(timeFormat.long),
241
+ medium: parseDateTimeSkeleton(timeFormat.medium),
242
+ short: parseDateTimeSkeleton(timeFormat.short),
244
243
  }, dateTimeFormat: {
245
- full: (0, skeleton_1.parseDateTimeSkeleton)(dateTimeFormat.full).pattern,
246
- long: (0, skeleton_1.parseDateTimeSkeleton)(dateTimeFormat.long).pattern,
247
- medium: (0, skeleton_1.parseDateTimeSkeleton)(dateTimeFormat.medium).pattern,
248
- short: (0, skeleton_1.parseDateTimeSkeleton)(dateTimeFormat.short).pattern,
244
+ full: parseDateTimeSkeleton(dateTimeFormat.full).pattern,
245
+ long: parseDateTimeSkeleton(dateTimeFormat.long).pattern,
246
+ medium: parseDateTimeSkeleton(dateTimeFormat.medium).pattern,
247
+ short: parseDateTimeSkeleton(dateTimeFormat.short).pattern,
249
248
  }, formats: {} });
250
249
  var _loop_2 = function (calendar) {
251
250
  processedData.formats[calendar] = Object.keys(formats[calendar]).map(function (skeleton) {
252
- return (0, skeleton_1.parseDateTimeSkeleton)(skeleton, formats[calendar][skeleton], intervalFormats[skeleton], intervalFormats.intervalFormatFallback);
251
+ return parseDateTimeSkeleton(skeleton, formats[calendar][skeleton], intervalFormats[skeleton], intervalFormats.intervalFormatFallback);
253
252
  });
254
253
  };
255
254
  for (var calendar in formats) {
@@ -258,11 +257,11 @@ exports.DateTimeFormat.__addLocaleData = function __addLocaleData() {
258
257
  var minimizedLocale = new Intl.Locale(locale)
259
258
  .minimize()
260
259
  .toString();
261
- exports.DateTimeFormat.localeData[locale] = exports.DateTimeFormat.localeData[minimizedLocale] = processedData;
262
- exports.DateTimeFormat.availableLocales.add(locale);
263
- exports.DateTimeFormat.availableLocales.add(minimizedLocale);
264
- if (!exports.DateTimeFormat.__defaultLocale) {
265
- exports.DateTimeFormat.__defaultLocale = minimizedLocale;
260
+ DateTimeFormat.localeData[locale] = DateTimeFormat.localeData[minimizedLocale] = processedData;
261
+ DateTimeFormat.availableLocales.add(locale);
262
+ DateTimeFormat.availableLocales.add(minimizedLocale);
263
+ if (!DateTimeFormat.__defaultLocale) {
264
+ DateTimeFormat.__defaultLocale = minimizedLocale;
266
265
  }
267
266
  };
268
267
  for (var _a = 0, data_1 = data; _a < data_1.length; _a++) {
@@ -270,34 +269,34 @@ exports.DateTimeFormat.__addLocaleData = function __addLocaleData() {
270
269
  _loop_1(d, locale);
271
270
  }
272
271
  };
273
- Object.defineProperty(exports.DateTimeFormat.prototype, 'format', formatDescriptor);
274
- exports.DateTimeFormat.__defaultLocale = '';
275
- exports.DateTimeFormat.localeData = {};
276
- exports.DateTimeFormat.availableLocales = new Set();
277
- exports.DateTimeFormat.getDefaultLocale = function () {
278
- return exports.DateTimeFormat.__defaultLocale;
272
+ Object.defineProperty(DateTimeFormat.prototype, 'format', formatDescriptor);
273
+ DateTimeFormat.__defaultLocale = '';
274
+ DateTimeFormat.localeData = {};
275
+ DateTimeFormat.availableLocales = new Set();
276
+ DateTimeFormat.getDefaultLocale = function () {
277
+ return DateTimeFormat.__defaultLocale;
279
278
  };
280
- exports.DateTimeFormat.polyfilled = true;
281
- exports.DateTimeFormat.tzData = {};
282
- exports.DateTimeFormat.__addTZData = function (d) {
283
- exports.DateTimeFormat.tzData = (0, packer_1.unpack)(d);
279
+ DateTimeFormat.polyfilled = true;
280
+ DateTimeFormat.tzData = {};
281
+ DateTimeFormat.__addTZData = function (d) {
282
+ DateTimeFormat.tzData = unpack(d);
284
283
  };
285
284
  try {
286
285
  if (typeof Symbol !== 'undefined') {
287
- Object.defineProperty(exports.DateTimeFormat.prototype, Symbol.toStringTag, {
286
+ Object.defineProperty(DateTimeFormat.prototype, Symbol.toStringTag, {
288
287
  value: 'Intl.DateTimeFormat',
289
288
  writable: false,
290
289
  enumerable: false,
291
290
  configurable: true,
292
291
  });
293
292
  }
294
- Object.defineProperty(exports.DateTimeFormat.prototype.constructor, 'length', {
293
+ Object.defineProperty(DateTimeFormat.prototype.constructor, 'length', {
295
294
  value: 1,
296
295
  writable: false,
297
296
  enumerable: false,
298
297
  configurable: true,
299
298
  });
300
299
  }
301
- catch (e) {
300
+ catch (_b) {
302
301
  // Meta fix so we're test262-compliant, not important
303
302
  }
@@ -1,5 +1,3 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
1
  // @generated
4
2
  // prettier-ignore
5
3
  var data = {
@@ -460,4 +458,4 @@ var data = {
460
458
  "Pacific/Wallis|,0,372,0|-100f9dh,0,372,0|-100f9dg,99,192,0|NaN,99,192,0"
461
459
  ]
462
460
  };
463
- exports.default = data;
461
+ export default data;
package/src/data/links.js CHANGED
@@ -1,8 +1,6 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
1
  // @generated
4
2
  // prettier-ignore
5
- exports.default = {
3
+ export default {
6
4
  "Africa/Accra": "Africa/Abidjan",
7
5
  "Africa/Addis_Ababa": "Africa/Nairobi",
8
6
  "Africa/Asmara": "Africa/Nairobi",
@@ -1,10 +1,7 @@
1
- "use strict";
2
1
  // Type-only circular import
3
2
  // eslint-disable-next-line import/no-cycle
4
- Object.defineProperty(exports, "__esModule", { value: true });
5
- exports.default = getInternalSlots;
6
3
  var internalSlotMap = new WeakMap();
7
- function getInternalSlots(x) {
4
+ export default function getInternalSlots(x) {
8
5
  var internalSlots = internalSlotMap.get(x);
9
6
  if (!internalSlots) {
10
7
  internalSlots = Object.create(null);
package/src/packer.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { UnpackedData, PackedData } from './types';
1
+ import { UnpackedData, PackedData } from './types.js';
2
2
  import { UnpackedZoneData } from '@formatjs/ecma402-abstract';
3
3
  export declare function pack(data: UnpackedData): PackedData;
4
4
  export declare function unpack(data: PackedData): Record<string, UnpackedZoneData[]>;
package/src/packer.js CHANGED
@@ -1,25 +1,21 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.pack = pack;
4
- exports.unpack = unpack;
5
- var tslib_1 = require("tslib");
6
- function pack(data) {
1
+ import { __spreadArray } from "tslib";
2
+ export function pack(data) {
7
3
  var zoneNames = Object.keys(data.zones);
8
4
  zoneNames.sort(); // so output is stable
9
5
  return {
10
6
  zones: zoneNames.map(function (zone) {
11
- return tslib_1.__spreadArray([
7
+ return __spreadArray([
12
8
  zone
13
9
  ], data.zones[zone].map(function (_a) {
14
10
  var ts = _a[0], others = _a.slice(1);
15
- return tslib_1.__spreadArray([ts === '' ? '' : ts.toString(36)], others, true).join(',');
11
+ return __spreadArray([ts === '' ? '' : ts.toString(36)], others, true).join(',');
16
12
  }), true).join('|');
17
13
  }),
18
14
  abbrvs: data.abbrvs.join('|'),
19
15
  offsets: data.offsets.map(function (o) { return o.toString(36); }).join('|'),
20
16
  };
21
17
  }
22
- function unpack(data) {
18
+ export function unpack(data) {
23
19
  var abbrvs = data.abbrvs.split('|');
24
20
  var offsets = data.offsets.split('|').map(function (n) { return parseInt(n, 36); });
25
21
  var packedZones = data.zones;
@@ -1,24 +1,19 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.toLocaleString = toLocaleString;
4
- exports.toLocaleDateString = toLocaleDateString;
5
- exports.toLocaleTimeString = toLocaleTimeString;
6
1
  // eslint-disable-next-line import/no-cycle
7
- var core_1 = require("./core");
8
- var ToDateTimeOptions_1 = require("./abstract/ToDateTimeOptions");
2
+ import { DateTimeFormat } from './core.js';
3
+ import { ToDateTimeOptions } from './abstract/ToDateTimeOptions.js';
9
4
  /**
10
5
  * Number.prototype.toLocaleString ponyfill
11
6
  * https://tc39.es/ecma402/#sup-number.prototype.tolocalestring
12
7
  */
13
- function toLocaleString(x, locales, options) {
14
- var dtf = new core_1.DateTimeFormat(locales, options);
8
+ export function toLocaleString(x, locales, options) {
9
+ var dtf = new DateTimeFormat(locales, options);
15
10
  return dtf.format(x);
16
11
  }
17
- function toLocaleDateString(x, locales, options) {
18
- var dtf = new core_1.DateTimeFormat(locales, (0, ToDateTimeOptions_1.ToDateTimeOptions)(options, 'date', 'date'));
12
+ export function toLocaleDateString(x, locales, options) {
13
+ var dtf = new DateTimeFormat(locales, ToDateTimeOptions(options, 'date', 'date'));
19
14
  return dtf.format(x);
20
15
  }
21
- function toLocaleTimeString(x, locales, options) {
22
- var dtf = new core_1.DateTimeFormat(locales, (0, ToDateTimeOptions_1.ToDateTimeOptions)(options, 'time', 'time'));
16
+ export function toLocaleTimeString(x, locales, options) {
17
+ var dtf = new DateTimeFormat(locales, ToDateTimeOptions(options, 'time', 'time'));
23
18
  return dtf.format(x);
24
19
  }
package/src/types.d.ts CHANGED
@@ -13,7 +13,7 @@ export interface UnpackedData {
13
13
  offsets: number[];
14
14
  }
15
15
  export type ZoneData = [
16
- number | string,
16
+ (number | string),
17
17
  number,
18
18
  number,
19
19
  number
package/src/types.js CHANGED
@@ -1,2 +1 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
1
+ export {};
@@ -1,4 +1 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.supportedLocales = void 0;
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"];
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"];
package/test262-main.d.ts CHANGED
@@ -1 +1 @@
1
- import './polyfill-force';
1
+ import './polyfill-force.js';
package/test262-main.js CHANGED
@@ -1,10 +1,7 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- var tslib_1 = require("tslib");
4
1
  /* @generated */
5
2
  // @ts-nocheck
6
- require("./polyfill-force");
7
- var all_tz_1 = tslib_1.__importDefault(require("./src/data/all-tz"));
3
+ import './polyfill-force.js';
4
+ import allData from './src/data/all-tz.js';
8
5
  defineProperty(Intl, 'DateTimeFormat', { value: DateTimeFormat });
9
6
  Intl.DateTimeFormat.__addLocaleData({
10
7
  "data": {
@@ -23786,4 +23783,4 @@ Intl.DateTimeFormat.__addLocaleData({
23786
23783
  },
23787
23784
  "locale": "zh"
23788
23785
  });
23789
- Intl.DateTimeFormat.__addTZData(all_tz_1.default);
23786
+ Intl.DateTimeFormat.__addTZData(allData);
package/lib/index.d.ts DELETED
@@ -1 +0,0 @@
1
- export * from './src/core';
package/lib/index.js DELETED
@@ -1 +0,0 @@
1
- export * from './src/core';
@@ -1 +0,0 @@
1
- export {};
@@ -1,44 +0,0 @@
1
- import { defineProperty } from '@formatjs/ecma402-abstract';
2
- import { DateTimeFormat } from './';
3
- import { toLocaleDateString as _toLocaleDateString, toLocaleString as _toLocaleString, toLocaleTimeString as _toLocaleTimeString, } from './src/to_locale_string';
4
- defineProperty(Intl, 'DateTimeFormat', { value: DateTimeFormat });
5
- defineProperty(Date.prototype, 'toLocaleString', {
6
- value: function toLocaleString(locales, options) {
7
- if (options === void 0) { options = {
8
- dateStyle: 'short',
9
- timeStyle: 'medium',
10
- }; }
11
- try {
12
- return _toLocaleString(this, locales, options);
13
- }
14
- catch (error) {
15
- return 'Invalid Date';
16
- }
17
- },
18
- });
19
- defineProperty(Date.prototype, 'toLocaleDateString', {
20
- value: function toLocaleDateString(locales, options) {
21
- if (options === void 0) { options = {
22
- dateStyle: 'short',
23
- }; }
24
- try {
25
- return _toLocaleDateString(this, locales, options);
26
- }
27
- catch (error) {
28
- return 'Invalid Date';
29
- }
30
- },
31
- });
32
- defineProperty(Date.prototype, 'toLocaleTimeString', {
33
- value: function toLocaleTimeString(locales, options) {
34
- if (options === void 0) { options = {
35
- timeStyle: 'medium',
36
- }; }
37
- try {
38
- return _toLocaleTimeString(this, locales, options);
39
- }
40
- catch (error) {
41
- return 'Invalid Date';
42
- }
43
- },
44
- });
package/lib/polyfill.d.ts DELETED
@@ -1 +0,0 @@
1
- export {};