atomic-fns 0.3.5 → 0.4.3

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 (109) hide show
  1. package/README.md +1 -12
  2. package/{core → dist}/collections/BTree.d.ts +6 -6
  3. package/{core → dist}/collections/BTree.js +17 -17
  4. package/{core → dist}/collections/Heap.d.ts +3 -3
  5. package/{core → dist}/collections/Heap.js +0 -0
  6. package/dist/collections/LRUCache.d.ts +80 -0
  7. package/dist/collections/LRUCache.js +126 -0
  8. package/{core → dist}/collections/SortedMap.d.ts +2 -2
  9. package/{core → dist}/collections/SortedMap.js +0 -0
  10. package/{core → dist}/collections/SortedSet.d.ts +3 -3
  11. package/{core → dist}/collections/SortedSet.js +1 -1
  12. package/{core → dist}/collections/SortedTree.d.ts +3 -3
  13. package/{core → dist}/collections/SortedTree.js +1 -1
  14. package/{core → dist}/collections/SplayTree.d.ts +5 -5
  15. package/{core → dist}/collections/SplayTree.js +0 -0
  16. package/{core → dist}/collections/abc.d.ts +0 -0
  17. package/{core → dist}/collections/abc.js +0 -0
  18. package/{core → dist}/collections/deque.d.ts +7 -7
  19. package/{core → dist}/collections/deque.js +6 -8
  20. package/{core → dist}/collections/frozenset.d.ts +0 -0
  21. package/{core → dist}/collections/frozenset.js +3 -6
  22. package/{core → dist}/collections/index.d.ts +207 -105
  23. package/{core → dist}/collections/index.js +179 -436
  24. package/{core → dist}/functools/index.d.ts +30 -16
  25. package/{core → dist}/functools/index.js +34 -12
  26. package/dist/globals/decimal.d.ts +142 -0
  27. package/dist/globals/decimal.js +371 -0
  28. package/{core → dist}/globals/index.d.ts +26 -25
  29. package/{core → dist}/globals/index.js +16 -37
  30. package/dist/i18n/currency.d.ts +24 -0
  31. package/dist/i18n/currency.js +85 -0
  32. package/dist/i18n/date/index.d.ts +204 -0
  33. package/dist/i18n/date/index.js +530 -0
  34. package/dist/i18n/date/utils.d.ts +65 -0
  35. package/dist/i18n/date/utils.js +290 -0
  36. package/dist/i18n/duration.d.ts +112 -0
  37. package/dist/i18n/duration.js +392 -0
  38. package/dist/i18n/format.d.ts +26 -0
  39. package/dist/i18n/format.js +495 -0
  40. package/{core → dist}/i18n/index.d.ts +2 -1
  41. package/{core → dist}/i18n/index.js +2 -1
  42. package/{core → dist}/index.d.ts +0 -0
  43. package/{core → dist}/index.js +0 -0
  44. package/{core → dist}/itertools/index.d.ts +74 -46
  45. package/{core → dist}/itertools/index.js +28 -56
  46. package/{core → dist}/math/index.d.ts +9 -10
  47. package/{core → dist}/math/index.js +3 -1
  48. package/{core → dist}/operators/index.d.ts +4 -4
  49. package/{core → dist}/operators/index.js +2 -8
  50. package/{core → dist}/random/index.d.ts +1 -1
  51. package/{core → dist}/random/index.js +5 -5
  52. package/package.json +28 -42
  53. package/.editorconfig +0 -12
  54. package/.esdoc.json +0 -27
  55. package/.eslintignore +0 -1
  56. package/.eslintrc.json +0 -35
  57. package/.firebaserc +0 -5
  58. package/.prettierrc +0 -19
  59. package/core/collections/BTree.ts +0 -1340
  60. package/core/collections/Heap.ts +0 -189
  61. package/core/collections/LRUCache.d.ts +0 -152
  62. package/core/collections/LRUCache.js +0 -409
  63. package/core/collections/LRUCache.ts +0 -486
  64. package/core/collections/SortedMap.ts +0 -146
  65. package/core/collections/SortedSet.ts +0 -110
  66. package/core/collections/SortedTree.ts +0 -160
  67. package/core/collections/SplayTree.ts +0 -354
  68. package/core/collections/abc.ts +0 -176
  69. package/core/collections/deque.ts +0 -338
  70. package/core/collections/frozenset.ts +0 -37
  71. package/core/collections/index.ts +0 -1024
  72. package/core/collections/test.html +0 -10
  73. package/core/collections/typedArrays.d.ts +0 -31
  74. package/core/collections/typedArrays.js +0 -143
  75. package/core/collections/typedArrays.ts +0 -163
  76. package/core/functools/index.ts +0 -260
  77. package/core/globals/index.ts +0 -481
  78. package/core/i18n/date/format.d.ts +0 -16
  79. package/core/i18n/date/format.js +0 -307
  80. package/core/i18n/date/format.ts +0 -343
  81. package/core/i18n/date/index.d.ts +0 -224
  82. package/core/i18n/date/index.js +0 -387
  83. package/core/i18n/date/index.ts +0 -471
  84. package/core/i18n/date/test.html +0 -67
  85. package/core/i18n/index.ts +0 -8
  86. package/core/index.ts +0 -8
  87. package/core/itertools/index.ts +0 -494
  88. package/core/math/index.ts +0 -152
  89. package/core/operators/index.ts +0 -310
  90. package/core/random/index.ts +0 -66
  91. package/firebase.json +0 -10
  92. package/jasmine.json +0 -14
  93. package/tests/BTree.spec.ts +0 -143
  94. package/tests/Cache.spec.ts +0 -161
  95. package/tests/Heap.spec.ts +0 -66
  96. package/tests/SortedMap.spec.ts +0 -144
  97. package/tests/SortedSet.spec.ts +0 -84
  98. package/tests/SortedTree.spec.ts +0 -164
  99. package/tests/SplayTree.spec.ts +0 -121
  100. package/tests/collections.spec.ts +0 -288
  101. package/tests/deque.spec.ts +0 -107
  102. package/tests/globals.spec.ts +0 -270
  103. package/tests/itertools.spec.ts +0 -266
  104. package/tests/math.spec.ts +0 -25
  105. package/tests/operators.spec.ts +0 -40
  106. package/tests/random.spec.ts +0 -46
  107. package/tsconfig.json +0 -126
  108. package/tsconfig.node.json +0 -18
  109. package/tsconfig.xo.json +0 -9
@@ -0,0 +1,495 @@
1
+ const NATIVE_DATE = /^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/;
2
+ const REGEX_PARSE = /^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/;
3
+ const REGEX_FORMAT = /\[([^\]]+)]|Y{1,4}|M{1,4}|Q|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|z{1,4}|N{1,4}|LTS?|L{1,4}|l{1,4}|x|X|SSS/g;
4
+ const FORMAT_DEFAULT = 'YYYY-MM-DDTHH:mm:ssZ';
5
+ const padStart = (string, length, pad) => String(string).padStart(length, pad);
6
+ const padZoneStr = (instance) => {
7
+ const negMinutes = -instance.getTimezoneOffset();
8
+ const minutes = Math.abs(negMinutes);
9
+ const hourOffset = Math.floor(minutes / 60);
10
+ const minuteOffset = minutes % 60;
11
+ return `${negMinutes <= 0 ? '+' : '-'}${padStart(hourOffset, 2, '0')}:${padStart(minuteOffset, 2, '0')}`;
12
+ };
13
+ /**
14
+ * Returns a new Date from the given arguments.
15
+ * @param {string | number | Date} date The date value
16
+ * @param {?boolean} [utc=false] Interprets the given value as a UTC date
17
+ * @returns {Date} The new date object
18
+ */
19
+ export function asDate(date, utc = false) {
20
+ if (date === null) {
21
+ return new Date(NaN);
22
+ }
23
+ if (date === undefined) {
24
+ date = Date.now();
25
+ }
26
+ if (typeof date === 'string' && !/Z$/i.test(date)) {
27
+ const d = date.match(NATIVE_DATE);
28
+ if (d) {
29
+ const m = d[2] - 1 || 0;
30
+ const ms = (d[7] || '0').slice(0, 3);
31
+ if (utc) {
32
+ return new Date(Date.UTC(d[1], m, d[3] || 1, d[4] || 0, d[5] || 0, d[6] || 0, ms));
33
+ }
34
+ return new Date(d[1], m, d[3] || 1, d[4] || 0, d[5] || 0, d[6] || 0, ms);
35
+ }
36
+ }
37
+ const fromDate = new Date(date);
38
+ if (utc) {
39
+ fromDate.setFullYear(fromDate.getUTCFullYear());
40
+ fromDate.setMonth(fromDate.getUTCMonth());
41
+ fromDate.setDate(fromDate.getUTCDate());
42
+ fromDate.setHours(fromDate.getUTCHours());
43
+ fromDate.setMinutes(fromDate.getUTCMinutes());
44
+ fromDate.setSeconds(fromDate.getUTCSeconds());
45
+ fromDate.setMilliseconds(fromDate.getUTCMilliseconds());
46
+ }
47
+ return fromDate;
48
+ }
49
+ const n = 'numeric';
50
+ const s = 'short';
51
+ const l = 'long';
52
+ const dd = '2-digit';
53
+ const STRFTIME = {
54
+ // weekday
55
+ '%A': { weekday: l },
56
+ '%a': { weekday: s },
57
+ '%aa': { weekday: n },
58
+ // day
59
+ '%d': { day: dd },
60
+ '%-d': { day: n },
61
+ // month
62
+ '%m': { month: dd },
63
+ '%-m': { month: n },
64
+ '%B': { month: l },
65
+ '%b': { month: s },
66
+ '%bb': { month: n },
67
+ // year
68
+ '%y': { year: n },
69
+ '%Y': { year: dd },
70
+ // hour
71
+ '%K': { hourCycle: 'h11', hour: dd },
72
+ '%I': { hourCycle: 'h12', hour: dd },
73
+ '%-I': { hourCycle: 'h12', hour: n },
74
+ '%H': { hourCycle: 'h23', hour: dd },
75
+ '%-H': { hourCycle: 'h23', hour: n },
76
+ '%k': { hourCycle: 'h24', hour: n },
77
+ // minutes
78
+ '%M': { minute: dd },
79
+ '%-M': { minute: n },
80
+ // seconds
81
+ '%S': { second: dd },
82
+ '%-S': { second: n },
83
+ // day period
84
+ '%P': { dayPeriod: l },
85
+ '%p': { dayPeriod: s },
86
+ '%pp': { dayPeriod: 'narrow' },
87
+ // era
88
+ '%N': { era: l, year: dd },
89
+ '%n': { era: s, year: dd },
90
+ '%nn': { era: n, year: 'narrow' },
91
+ // timeZoneName
92
+ // '%Z': { timeZoneName: 'longGeneric', year: dd },
93
+ // '%-Z': { timeZoneName: 'shortGeneric', year: dd },
94
+ '%z': { timeZoneName: 'longOffset', year: dd },
95
+ '%-z': { timeZoneName: 'shortOffset', year: dd },
96
+ '%Z': { timeZoneName: l, year: dd },
97
+ '%-Z': { timeZoneName: s, year: dd }
98
+ };
99
+ const TOKENS = {
100
+ // weekday
101
+ dddd: { weekday: l },
102
+ ddd: { weekday: s },
103
+ E: { weekday: n },
104
+ // day
105
+ DD: { day: dd },
106
+ D: { day: n },
107
+ // month
108
+ MM: { month: dd },
109
+ M: { month: n },
110
+ MMMM: { month: l },
111
+ MMM: { month: s },
112
+ // year
113
+ YYYY: { year: n },
114
+ YY: { year: dd },
115
+ // hour
116
+ hh: { hourCycle: 'h12', hour: dd },
117
+ h: { hourCycle: 'h12', hour: n },
118
+ HH: { hourCycle: 'h23', hour: dd },
119
+ H: { hourCycle: 'h23', hour: n },
120
+ kk: { hourCycle: 'h11', hour: dd },
121
+ k: { hourCycle: 'h24', hour: n },
122
+ // minutes
123
+ mm: { minute: dd },
124
+ m: { minute: n },
125
+ // seconds
126
+ ss: { second: dd },
127
+ s: { second: n },
128
+ // day period
129
+ A: { dayPeriod: l },
130
+ a: { dayPeriod: s },
131
+ // era
132
+ N: { era: s, year: dd },
133
+ NN: { era: s, year: dd },
134
+ NNN: { era: s, year: dd },
135
+ NNNN: { era: l, year: dd },
136
+ // timeZoneName
137
+ ZZ: { timeZoneName: 'longOffset', year: dd },
138
+ Z: { timeZoneName: 'shortOffset', year: dd },
139
+ zzz: { timeZoneName: l, year: dd },
140
+ z: { timeZoneName: s, year: dd }
141
+ };
142
+ const HOUR_PARTS = { '%I': 1, '%-I': 1, '%K': 1, '%k': 1 };
143
+ const ERA_PARTS = { '%n': 1, '%N': 1, '%nn': 1 };
144
+ const TZ_PARTS = { '%ZZ': 1, '%-ZZ': 1, '%-z': 1, '%z': 1, '%-Z': 1, '%Z': 1 };
145
+ const formatter = (locale, opts) => new Intl.DateTimeFormat(locale, opts);
146
+ const formatHour = (h, maxLength) => String(h % 12 || 12).padStart(maxLength, '0');
147
+ const formatMeridiem = (hour, isLowercase) => {
148
+ const m = hour < 12 ? 'AM' : 'PM';
149
+ return isLowercase ? m.toLowerCase() : m;
150
+ };
151
+ const formatPart = (locale, t, date) => {
152
+ const value = formatter(locale, TOKENS[t]).format(date);
153
+ return value.split(/\s+/g).slice(1).join(' ');
154
+ };
155
+ /**
156
+ * Returns a localized string representation of this date, according to the given format string. Format codes use the same specification as {@link https://momentjs.com/docs/#/displaying/format/ moment}.
157
+ * @param {string} str The format string to use
158
+ * @see {@link https://momentjs.com/docs/#/displaying/format/ List of formats}
159
+ * @example
160
+ ```js
161
+ formatDate(new Date(), 'MM/DD/YYYY') // '10/31/2022'
162
+ ```
163
+ */
164
+ export function formatDate(formatStr, date, locale) {
165
+ const str = formatStr || FORMAT_DEFAULT;
166
+ const zoneStr = padZoneStr(date);
167
+ const time = {
168
+ H: date.getHours(),
169
+ HH: padStart(date.getHours(), 2, '0'),
170
+ h: formatHour(date.getHours(), 1),
171
+ hh: formatHour(date.getHours(), 2),
172
+ a: formatMeridiem(date.getHours(), true),
173
+ A: formatMeridiem(date.getHours()),
174
+ m: date.getMinutes(),
175
+ mm: padStart(date.getMinutes(), 2, '0'),
176
+ s: date.getSeconds(),
177
+ ss: padStart(date.getSeconds(), 2, '0'),
178
+ SSS: padStart(date.getMilliseconds(), 3, '0'),
179
+ X: Math.floor(date.getTime() / 1000),
180
+ x: date.getTime()
181
+ };
182
+ const matches = {
183
+ ...time,
184
+ N: formatPart(locale, 'N', date),
185
+ NN: formatPart(locale, 'NN', date),
186
+ NNN: formatPart(locale, 'NNN', date),
187
+ NNNN: formatPart(locale, 'NNNN', date),
188
+ YY: String(date.getFullYear()).slice(-2),
189
+ YYYY: date.getFullYear(),
190
+ M: date.getMonth() + 1,
191
+ MM: padStart(date.getMonth() + 1, 2, '0'),
192
+ MMM: formatter(locale, TOKENS.MMM).format(date),
193
+ MMMM: formatter(locale, TOKENS.MMMM).format(date),
194
+ Q: Math.ceil((date.getMonth() + 1) / 3),
195
+ D: date.getDate(),
196
+ DD: padStart(date.getDate(), 2, '0'),
197
+ d: date.getDay(),
198
+ ddd: formatter(locale, TOKENS.ddd).format(date),
199
+ dddd: formatter(locale, TOKENS.dddd).format(date),
200
+ Z: formatPart(locale, 'Z', date),
201
+ ZZ: formatPart(locale, 'ZZ', date),
202
+ z: formatPart(locale, 'z', date),
203
+ zzz: formatPart(locale, 'zzz', date),
204
+ LT: `${time.h}:${time.mm} ${time.A}`,
205
+ LTS: `${time.h}:${time.mm}:${time.ss} ${time.A}`,
206
+ L: formatter(locale, DATE_SHORT_DD).format(date),
207
+ LL: formatter(locale, DATE_FULL).format(date),
208
+ LLL: formatter(locale, DATE_LONG_TIME).format(date),
209
+ LLLL: formatter(locale, DATE_HUGE).format(date),
210
+ l: formatter(locale, DATE_SHORT).format(date),
211
+ ll: formatter(locale, DATE_MED).format(date),
212
+ lll: formatter(locale, DATE_MED_TIME).format(date),
213
+ llll: formatter(locale, DATE_MED_WITH_WEEKDAY).format(date)
214
+ };
215
+ return str.replace(REGEX_FORMAT, (match, $1) => $1 || matches[match] || zoneStr.replace(':', '')); // 'ZZ'
216
+ }
217
+ /**
218
+ * Formats a date using a formatting string in the {@link https://strftime.org/ strftime} format, in any given locale.
219
+ * @param {string} fmt The format string to apply
220
+ * @param {Date} date The date value
221
+ * @param {?string} locale The locale to use when formatting (default is system locale).
222
+ * @returns {string} The string representation of date
223
+ * @see {@link https://strftime.org/ strftime format}
224
+ */
225
+ export function strftime(fmt, date, locale) {
226
+ const results = [];
227
+ let dayPeriod = '';
228
+ let dayPeriodIndex = -1;
229
+ for (let i = 0; i < fmt.length; i++) {
230
+ let part = fmt[i];
231
+ if (part === '%') {
232
+ // check for escaped '%'
233
+ if (fmt[++i] === '%') {
234
+ results.push('%');
235
+ continue;
236
+ }
237
+ if (fmt[i] === '-') {
238
+ part += fmt[i++];
239
+ }
240
+ part += fmt[i];
241
+ // add any repeated characters that come after
242
+ while (i < fmt.length - 1 && fmt[i + 1] === fmt[i])
243
+ part += fmt[++i];
244
+ if (HOUR_PARTS[part]) {
245
+ const res = formatter(locale, STRFTIME[part]).format(date).split(/\s+/g);
246
+ // save the AM/PM for the correct spot
247
+ results.push(res[0]);
248
+ dayPeriod = res[1];
249
+ continue;
250
+ }
251
+ if (part === '%P' || part === '%p') {
252
+ // leave this flag in place for later
253
+ dayPeriodIndex = results.length;
254
+ if (part === '%p' && dayPeriod) {
255
+ dayPeriod = dayPeriod.toLowerCase();
256
+ }
257
+ results.push(part);
258
+ continue;
259
+ }
260
+ if (ERA_PARTS[part] || TZ_PARTS[part]) {
261
+ // the formatting includes the date/year so we take what comes after
262
+ const res = formatter(locale, STRFTIME[part]).format(date).split(/\s+/g);
263
+ results.push(res.slice(1).join(' '));
264
+ continue;
265
+ }
266
+ // format any other parts
267
+ let res = formatter(locale, STRFTIME[part]).format(date);
268
+ // fix bugs in time formatter
269
+ if ((part === '%S' || part === '%M') && res.length === 1)
270
+ res = '0' + res;
271
+ results.push(res);
272
+ }
273
+ else {
274
+ // output as literal
275
+ results.push(part);
276
+ }
277
+ }
278
+ // insert the AM/PM at the correct spot
279
+ if (dayPeriodIndex >= 0)
280
+ results[dayPeriodIndex] = dayPeriod || '';
281
+ return results.join('').trim();
282
+ }
283
+ const DATETIME_DEFAULT = {};
284
+ /** L: 09/04/1983 */
285
+ const DATE_SHORT_DD = {
286
+ year: n,
287
+ month: dd,
288
+ day: dd
289
+ };
290
+ /** l: 9/4/1983 */
291
+ const DATE_SHORT = {
292
+ year: n,
293
+ month: n,
294
+ day: n
295
+ };
296
+ /** ll: Oct 14, 1983 */
297
+ const DATE_MED = {
298
+ year: n,
299
+ month: s,
300
+ day: n
301
+ };
302
+ /** LL: October 14, 1983 */
303
+ const DATE_FULL = {
304
+ year: n,
305
+ month: l,
306
+ day: n
307
+ };
308
+ /** lll: Oct 14, 1983 8:30 PM */
309
+ const DATE_MED_TIME = {
310
+ year: n,
311
+ month: s,
312
+ day: n,
313
+ hour: n,
314
+ minute: n,
315
+ hourCycle: 'h12'
316
+ };
317
+ /** LLL: October 14, 1983 8:30 PM */
318
+ const DATE_LONG_TIME = {
319
+ year: n,
320
+ month: l,
321
+ day: n,
322
+ hour: n,
323
+ minute: n,
324
+ hourCycle: 'h12'
325
+ };
326
+ /** llll: Fri, Oct 14, 1983, 8:30 PM */
327
+ const DATE_MED_WITH_WEEKDAY = {
328
+ year: n,
329
+ month: s,
330
+ day: n,
331
+ weekday: s,
332
+ hour: n,
333
+ minute: n,
334
+ hourCycle: 'h12'
335
+ };
336
+ /** LLLL: Tuesday, October 14, 1983, 8:30 PM */
337
+ const DATE_HUGE = {
338
+ year: n,
339
+ month: l,
340
+ day: n,
341
+ weekday: l,
342
+ hour: n,
343
+ minute: n,
344
+ hourCycle: 'h12'
345
+ };
346
+ /** LT: 09:30 AM */
347
+ const TIME_SIMPLE = {
348
+ hour: n,
349
+ minute: n,
350
+ hourCycle: 'h12'
351
+ };
352
+ /** LTS: 09:30:23 AM */
353
+ const TIME_WITH_SECONDS = {
354
+ hour: n,
355
+ minute: n,
356
+ second: n,
357
+ hourCycle: 'h12'
358
+ };
359
+ /** 09:30:23 AM EDT */
360
+ const TIME_WITH_SHORT_OFFSET = {
361
+ hour: n,
362
+ minute: n,
363
+ second: n,
364
+ timeZoneName: s,
365
+ hourCycle: 'h12'
366
+ };
367
+ /** 09:30:23 AM Eastern Daylight Time */
368
+ const TIME_WITH_LONG_OFFSET = {
369
+ hour: n,
370
+ minute: n,
371
+ second: n,
372
+ timeZoneName: l,
373
+ hourCycle: 'h12'
374
+ };
375
+ /** 09:30 */
376
+ const TIME_24_SIMPLE = {
377
+ hour: n,
378
+ minute: n,
379
+ hourCycle: 'h23'
380
+ };
381
+ /** 09:30:23 */
382
+ const TIME_24_WITH_SECONDS = {
383
+ hour: n,
384
+ minute: n,
385
+ second: n,
386
+ hourCycle: 'h23'
387
+ };
388
+ /** 09:30:23 EDT */
389
+ const TIME_24_WITH_SHORT_OFFSET = {
390
+ hour: n,
391
+ minute: n,
392
+ second: n,
393
+ hourCycle: 'h23',
394
+ timeZoneName: s
395
+ };
396
+ /** 09:30:23 Eastern Daylight Time */
397
+ const TIME_24_WITH_LONG_OFFSET = {
398
+ hour: n,
399
+ minute: n,
400
+ second: n,
401
+ hourCycle: 'h23',
402
+ timeZoneName: l
403
+ };
404
+ /** 10/14/1983, 9:30 AM */
405
+ const DATETIME_SHORT = {
406
+ year: n,
407
+ month: n,
408
+ day: n,
409
+ hour: n,
410
+ minute: n,
411
+ hourCycle: 'h12'
412
+ };
413
+ /** 10/14/1983, 9:30:33 AM */
414
+ const DATETIME_SHORT_WITH_SECONDS = {
415
+ year: n,
416
+ month: n,
417
+ day: n,
418
+ hour: n,
419
+ minute: n,
420
+ second: n,
421
+ hourCycle: 'h12'
422
+ };
423
+ /** Oct 14, 1983, 9:30 AM */
424
+ const DATETIME_MED = {
425
+ year: n,
426
+ month: s,
427
+ day: n,
428
+ hour: n,
429
+ minute: n,
430
+ hourCycle: 'h12'
431
+ };
432
+ /** Oct 14, 1983, 9:30:33 AM */
433
+ const DATETIME_MED_WITH_SECONDS = {
434
+ year: n,
435
+ month: s,
436
+ day: n,
437
+ hour: n,
438
+ minute: n,
439
+ second: n,
440
+ hourCycle: 'h12'
441
+ };
442
+ /** Fri, 14 Oct 1983, 9:30 AM */
443
+ const DATETIME_MED_WITH_WEEKDAY = {
444
+ year: n,
445
+ month: s,
446
+ day: n,
447
+ weekday: s,
448
+ hour: n,
449
+ minute: n,
450
+ hourCycle: 'h12'
451
+ };
452
+ /** October 14, 1983, 9:30 AM EDT */
453
+ const DATETIME_FULL = {
454
+ year: n,
455
+ month: l,
456
+ day: n,
457
+ hour: n,
458
+ minute: n,
459
+ timeZoneName: s,
460
+ hourCycle: 'h12'
461
+ };
462
+ /** October 14, 1983, 9:30:33 AM EDT */
463
+ const DATETIME_FULL_WITH_SECONDS = {
464
+ year: n,
465
+ month: l,
466
+ day: n,
467
+ hour: n,
468
+ minute: n,
469
+ second: n,
470
+ timeZoneName: s,
471
+ hourCycle: 'h12'
472
+ };
473
+ /** Friday, October 14, 1983, 9:30 AM Eastern Daylight Time */
474
+ const DATETIME_HUGE = {
475
+ year: n,
476
+ month: l,
477
+ day: n,
478
+ weekday: l,
479
+ hour: n,
480
+ minute: n,
481
+ timeZoneName: l,
482
+ hourCycle: 'h12'
483
+ };
484
+ /** Friday, October 14, 1983, 9:30:33 AM Eastern Daylight Time */
485
+ const DATETIME_HUGE_WITH_SECONDS = {
486
+ year: n,
487
+ month: l,
488
+ day: n,
489
+ weekday: l,
490
+ hour: n,
491
+ minute: n,
492
+ second: n,
493
+ timeZoneName: l,
494
+ hourCycle: 'h12'
495
+ };
@@ -3,5 +3,6 @@
3
3
  *
4
4
  * @module i18n
5
5
  */
6
+ export * from './currency.js';
6
7
  export * from './date/index.js';
7
- export * from './date/format.js';
8
+ export { Duration, TDuration, DurationUnit } from './duration.js';
@@ -3,5 +3,6 @@
3
3
  *
4
4
  * @module i18n
5
5
  */
6
+ export * from './currency.js';
6
7
  export * from './date/index.js';
7
- export * from './date/format.js';
8
+ export { Duration } from './duration.js';
File without changes
File without changes