@chainflip/utils 0.4.1 → 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.
package/dist/date.cjs CHANGED
@@ -31,360 +31,8 @@ __export(date_exports, {
31
31
  toStartOfUtcDayString: () => toStartOfUtcDayString
32
32
  });
33
33
  module.exports = __toCommonJS(date_exports);
34
-
35
- // ../../node_modules/.pnpm/@babel+runtime@7.26.0/node_modules/@babel/runtime/helpers/esm/typeof.js
36
- function _typeof(o) {
37
- "@babel/helpers - typeof";
38
- return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o2) {
39
- return typeof o2;
40
- } : function(o2) {
41
- return o2 && "function" == typeof Symbol && o2.constructor === Symbol && o2 !== Symbol.prototype ? "symbol" : typeof o2;
42
- }, _typeof(o);
43
- }
44
-
45
- // ../../node_modules/.pnpm/date-fns@2.30.0/node_modules/date-fns/esm/_lib/toInteger/index.js
46
- function toInteger(dirtyNumber) {
47
- if (dirtyNumber === null || dirtyNumber === true || dirtyNumber === false) {
48
- return NaN;
49
- }
50
- var number = Number(dirtyNumber);
51
- if (isNaN(number)) {
52
- return number;
53
- }
54
- return number < 0 ? Math.ceil(number) : Math.floor(number);
55
- }
56
-
57
- // ../../node_modules/.pnpm/date-fns@2.30.0/node_modules/date-fns/esm/_lib/requiredArgs/index.js
58
- function requiredArgs(required, args) {
59
- if (args.length < required) {
60
- throw new TypeError(required + " argument" + (required > 1 ? "s" : "") + " required, but only " + args.length + " present");
61
- }
62
- }
63
-
64
- // ../../node_modules/.pnpm/date-fns@2.30.0/node_modules/date-fns/esm/toDate/index.js
65
- function toDate(argument) {
66
- requiredArgs(1, arguments);
67
- var argStr = Object.prototype.toString.call(argument);
68
- if (argument instanceof Date || _typeof(argument) === "object" && argStr === "[object Date]") {
69
- return new Date(argument.getTime());
70
- } else if (typeof argument === "number" || argStr === "[object Number]") {
71
- return new Date(argument);
72
- } else {
73
- if ((typeof argument === "string" || argStr === "[object String]") && typeof console !== "undefined") {
74
- console.warn("Starting with v2.0.0-beta.1 date-fns doesn't accept strings as date arguments. Please use `parseISO` to parse strings. See: https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#string-arguments");
75
- console.warn(new Error().stack);
76
- }
77
- return /* @__PURE__ */ new Date(NaN);
78
- }
79
- }
80
-
81
- // ../../node_modules/.pnpm/date-fns@2.30.0/node_modules/date-fns/esm/addDays/index.js
82
- function addDays(dirtyDate, dirtyAmount) {
83
- requiredArgs(2, arguments);
84
- var date = toDate(dirtyDate);
85
- var amount = toInteger(dirtyAmount);
86
- if (isNaN(amount)) {
87
- return /* @__PURE__ */ new Date(NaN);
88
- }
89
- if (!amount) {
90
- return date;
91
- }
92
- date.setDate(date.getDate() + amount);
93
- return date;
94
- }
95
-
96
- // ../../node_modules/.pnpm/date-fns@2.30.0/node_modules/date-fns/esm/addMonths/index.js
97
- function addMonths(dirtyDate, dirtyAmount) {
98
- requiredArgs(2, arguments);
99
- var date = toDate(dirtyDate);
100
- var amount = toInteger(dirtyAmount);
101
- if (isNaN(amount)) {
102
- return /* @__PURE__ */ new Date(NaN);
103
- }
104
- if (!amount) {
105
- return date;
106
- }
107
- var dayOfMonth = date.getDate();
108
- var endOfDesiredMonth = new Date(date.getTime());
109
- endOfDesiredMonth.setMonth(date.getMonth() + amount + 1, 0);
110
- var daysInMonth = endOfDesiredMonth.getDate();
111
- if (dayOfMonth >= daysInMonth) {
112
- return endOfDesiredMonth;
113
- } else {
114
- date.setFullYear(endOfDesiredMonth.getFullYear(), endOfDesiredMonth.getMonth(), dayOfMonth);
115
- return date;
116
- }
117
- }
118
-
119
- // ../../node_modules/.pnpm/date-fns@2.30.0/node_modules/date-fns/esm/add/index.js
120
- function add(dirtyDate, duration) {
121
- requiredArgs(2, arguments);
122
- if (!duration || _typeof(duration) !== "object") return /* @__PURE__ */ new Date(NaN);
123
- var years = duration.years ? toInteger(duration.years) : 0;
124
- var months = duration.months ? toInteger(duration.months) : 0;
125
- var weeks = duration.weeks ? toInteger(duration.weeks) : 0;
126
- var days = duration.days ? toInteger(duration.days) : 0;
127
- var hours = duration.hours ? toInteger(duration.hours) : 0;
128
- var minutes = duration.minutes ? toInteger(duration.minutes) : 0;
129
- var seconds = duration.seconds ? toInteger(duration.seconds) : 0;
130
- var date = toDate(dirtyDate);
131
- var dateWithMonths = months || years ? addMonths(date, months + years * 12) : date;
132
- var dateWithDays = days || weeks ? addDays(dateWithMonths, days + weeks * 7) : dateWithMonths;
133
- var minutesToAdd = minutes + hours * 60;
134
- var secondsToAdd = seconds + minutesToAdd * 60;
135
- var msToAdd = secondsToAdd * 1e3;
136
- var finalDate = new Date(dateWithDays.getTime() + msToAdd);
137
- return finalDate;
138
- }
139
-
140
- // ../../node_modules/.pnpm/date-fns@2.30.0/node_modules/date-fns/esm/addMilliseconds/index.js
141
- function addMilliseconds(dirtyDate, dirtyAmount) {
142
- requiredArgs(2, arguments);
143
- var timestamp = toDate(dirtyDate).getTime();
144
- var amount = toInteger(dirtyAmount);
145
- return new Date(timestamp + amount);
146
- }
147
-
148
- // ../../node_modules/.pnpm/date-fns@2.30.0/node_modules/date-fns/esm/addHours/index.js
149
- var MILLISECONDS_IN_HOUR = 36e5;
150
- function addHours(dirtyDate, dirtyAmount) {
151
- requiredArgs(2, arguments);
152
- var amount = toInteger(dirtyAmount);
153
- return addMilliseconds(dirtyDate, amount * MILLISECONDS_IN_HOUR);
154
- }
155
-
156
- // ../../node_modules/.pnpm/date-fns@2.30.0/node_modules/date-fns/esm/_lib/getTimezoneOffsetInMilliseconds/index.js
157
- function getTimezoneOffsetInMilliseconds(date) {
158
- var utcDate = new Date(Date.UTC(date.getFullYear(), date.getMonth(), date.getDate(), date.getHours(), date.getMinutes(), date.getSeconds(), date.getMilliseconds()));
159
- utcDate.setUTCFullYear(date.getFullYear());
160
- return date.getTime() - utcDate.getTime();
161
- }
162
-
163
- // ../../node_modules/.pnpm/date-fns@2.30.0/node_modules/date-fns/esm/startOfDay/index.js
164
- function startOfDay(dirtyDate) {
165
- requiredArgs(1, arguments);
166
- var date = toDate(dirtyDate);
167
- date.setHours(0, 0, 0, 0);
168
- return date;
169
- }
170
-
171
- // ../../node_modules/.pnpm/date-fns@2.30.0/node_modules/date-fns/esm/differenceInCalendarDays/index.js
172
- var MILLISECONDS_IN_DAY = 864e5;
173
- function differenceInCalendarDays(dirtyDateLeft, dirtyDateRight) {
174
- requiredArgs(2, arguments);
175
- var startOfDayLeft = startOfDay(dirtyDateLeft);
176
- var startOfDayRight = startOfDay(dirtyDateRight);
177
- var timestampLeft = startOfDayLeft.getTime() - getTimezoneOffsetInMilliseconds(startOfDayLeft);
178
- var timestampRight = startOfDayRight.getTime() - getTimezoneOffsetInMilliseconds(startOfDayRight);
179
- return Math.round((timestampLeft - timestampRight) / MILLISECONDS_IN_DAY);
180
- }
181
-
182
- // ../../node_modules/.pnpm/date-fns@2.30.0/node_modules/date-fns/esm/compareAsc/index.js
183
- function compareAsc(dirtyDateLeft, dirtyDateRight) {
184
- requiredArgs(2, arguments);
185
- var dateLeft = toDate(dirtyDateLeft);
186
- var dateRight = toDate(dirtyDateRight);
187
- var diff = dateLeft.getTime() - dateRight.getTime();
188
- if (diff < 0) {
189
- return -1;
190
- } else if (diff > 0) {
191
- return 1;
192
- } else {
193
- return diff;
194
- }
195
- }
196
-
197
- // ../../node_modules/.pnpm/date-fns@2.30.0/node_modules/date-fns/esm/constants/index.js
198
- var daysInYear = 365.2425;
199
- var maxTime = Math.pow(10, 8) * 24 * 60 * 60 * 1e3;
200
- var millisecondsInMinute = 6e4;
201
- var millisecondsInHour = 36e5;
202
- var minTime = -maxTime;
203
- var secondsInHour = 3600;
204
- var secondsInDay = secondsInHour * 24;
205
- var secondsInWeek = secondsInDay * 7;
206
- var secondsInYear = secondsInDay * daysInYear;
207
- var secondsInMonth = secondsInYear / 12;
208
- var secondsInQuarter = secondsInMonth * 3;
209
-
210
- // ../../node_modules/.pnpm/date-fns@2.30.0/node_modules/date-fns/esm/differenceInCalendarMonths/index.js
211
- function differenceInCalendarMonths(dirtyDateLeft, dirtyDateRight) {
212
- requiredArgs(2, arguments);
213
- var dateLeft = toDate(dirtyDateLeft);
214
- var dateRight = toDate(dirtyDateRight);
215
- var yearDiff = dateLeft.getFullYear() - dateRight.getFullYear();
216
- var monthDiff = dateLeft.getMonth() - dateRight.getMonth();
217
- return yearDiff * 12 + monthDiff;
218
- }
219
-
220
- // ../../node_modules/.pnpm/date-fns@2.30.0/node_modules/date-fns/esm/differenceInCalendarYears/index.js
221
- function differenceInCalendarYears(dirtyDateLeft, dirtyDateRight) {
222
- requiredArgs(2, arguments);
223
- var dateLeft = toDate(dirtyDateLeft);
224
- var dateRight = toDate(dirtyDateRight);
225
- return dateLeft.getFullYear() - dateRight.getFullYear();
226
- }
227
-
228
- // ../../node_modules/.pnpm/date-fns@2.30.0/node_modules/date-fns/esm/differenceInDays/index.js
229
- function compareLocalAsc(dateLeft, dateRight) {
230
- var diff = dateLeft.getFullYear() - dateRight.getFullYear() || dateLeft.getMonth() - dateRight.getMonth() || dateLeft.getDate() - dateRight.getDate() || dateLeft.getHours() - dateRight.getHours() || dateLeft.getMinutes() - dateRight.getMinutes() || dateLeft.getSeconds() - dateRight.getSeconds() || dateLeft.getMilliseconds() - dateRight.getMilliseconds();
231
- if (diff < 0) {
232
- return -1;
233
- } else if (diff > 0) {
234
- return 1;
235
- } else {
236
- return diff;
237
- }
238
- }
239
- function differenceInDays(dirtyDateLeft, dirtyDateRight) {
240
- requiredArgs(2, arguments);
241
- var dateLeft = toDate(dirtyDateLeft);
242
- var dateRight = toDate(dirtyDateRight);
243
- var sign = compareLocalAsc(dateLeft, dateRight);
244
- var difference = Math.abs(differenceInCalendarDays(dateLeft, dateRight));
245
- dateLeft.setDate(dateLeft.getDate() - sign * difference);
246
- var isLastDayNotFull = Number(compareLocalAsc(dateLeft, dateRight) === -sign);
247
- var result = sign * (difference - isLastDayNotFull);
248
- return result === 0 ? 0 : result;
249
- }
250
-
251
- // ../../node_modules/.pnpm/date-fns@2.30.0/node_modules/date-fns/esm/differenceInMilliseconds/index.js
252
- function differenceInMilliseconds(dateLeft, dateRight) {
253
- requiredArgs(2, arguments);
254
- return toDate(dateLeft).getTime() - toDate(dateRight).getTime();
255
- }
256
-
257
- // ../../node_modules/.pnpm/date-fns@2.30.0/node_modules/date-fns/esm/_lib/roundingMethods/index.js
258
- var roundingMap = {
259
- ceil: Math.ceil,
260
- round: Math.round,
261
- floor: Math.floor,
262
- trunc: function trunc(value) {
263
- return value < 0 ? Math.ceil(value) : Math.floor(value);
264
- }
265
- // Math.trunc is not supported by IE
266
- };
267
- var defaultRoundingMethod = "trunc";
268
- function getRoundingMethod(method) {
269
- return method ? roundingMap[method] : roundingMap[defaultRoundingMethod];
270
- }
271
-
272
- // ../../node_modules/.pnpm/date-fns@2.30.0/node_modules/date-fns/esm/differenceInHours/index.js
273
- function differenceInHours(dateLeft, dateRight, options) {
274
- requiredArgs(2, arguments);
275
- var diff = differenceInMilliseconds(dateLeft, dateRight) / millisecondsInHour;
276
- return getRoundingMethod(options === null || options === void 0 ? void 0 : options.roundingMethod)(diff);
277
- }
278
-
279
- // ../../node_modules/.pnpm/date-fns@2.30.0/node_modules/date-fns/esm/differenceInMinutes/index.js
280
- function differenceInMinutes(dateLeft, dateRight, options) {
281
- requiredArgs(2, arguments);
282
- var diff = differenceInMilliseconds(dateLeft, dateRight) / millisecondsInMinute;
283
- return getRoundingMethod(options === null || options === void 0 ? void 0 : options.roundingMethod)(diff);
284
- }
285
-
286
- // ../../node_modules/.pnpm/date-fns@2.30.0/node_modules/date-fns/esm/endOfDay/index.js
287
- function endOfDay(dirtyDate) {
288
- requiredArgs(1, arguments);
289
- var date = toDate(dirtyDate);
290
- date.setHours(23, 59, 59, 999);
291
- return date;
292
- }
293
-
294
- // ../../node_modules/.pnpm/date-fns@2.30.0/node_modules/date-fns/esm/endOfMonth/index.js
295
- function endOfMonth(dirtyDate) {
296
- requiredArgs(1, arguments);
297
- var date = toDate(dirtyDate);
298
- var month = date.getMonth();
299
- date.setFullYear(date.getFullYear(), month + 1, 0);
300
- date.setHours(23, 59, 59, 999);
301
- return date;
302
- }
303
-
304
- // ../../node_modules/.pnpm/date-fns@2.30.0/node_modules/date-fns/esm/isLastDayOfMonth/index.js
305
- function isLastDayOfMonth(dirtyDate) {
306
- requiredArgs(1, arguments);
307
- var date = toDate(dirtyDate);
308
- return endOfDay(date).getTime() === endOfMonth(date).getTime();
309
- }
310
-
311
- // ../../node_modules/.pnpm/date-fns@2.30.0/node_modules/date-fns/esm/differenceInMonths/index.js
312
- function differenceInMonths(dirtyDateLeft, dirtyDateRight) {
313
- requiredArgs(2, arguments);
314
- var dateLeft = toDate(dirtyDateLeft);
315
- var dateRight = toDate(dirtyDateRight);
316
- var sign = compareAsc(dateLeft, dateRight);
317
- var difference = Math.abs(differenceInCalendarMonths(dateLeft, dateRight));
318
- var result;
319
- if (difference < 1) {
320
- result = 0;
321
- } else {
322
- if (dateLeft.getMonth() === 1 && dateLeft.getDate() > 27) {
323
- dateLeft.setDate(30);
324
- }
325
- dateLeft.setMonth(dateLeft.getMonth() - sign * difference);
326
- var isLastMonthNotFull = compareAsc(dateLeft, dateRight) === -sign;
327
- if (isLastDayOfMonth(toDate(dirtyDateLeft)) && difference === 1 && compareAsc(dirtyDateLeft, dateRight) === 1) {
328
- isLastMonthNotFull = false;
329
- }
330
- result = sign * (difference - Number(isLastMonthNotFull));
331
- }
332
- return result === 0 ? 0 : result;
333
- }
334
-
335
- // ../../node_modules/.pnpm/date-fns@2.30.0/node_modules/date-fns/esm/differenceInSeconds/index.js
336
- function differenceInSeconds(dateLeft, dateRight, options) {
337
- requiredArgs(2, arguments);
338
- var diff = differenceInMilliseconds(dateLeft, dateRight) / 1e3;
339
- return getRoundingMethod(options === null || options === void 0 ? void 0 : options.roundingMethod)(diff);
340
- }
341
-
342
- // ../../node_modules/.pnpm/date-fns@2.30.0/node_modules/date-fns/esm/differenceInYears/index.js
343
- function differenceInYears(dirtyDateLeft, dirtyDateRight) {
344
- requiredArgs(2, arguments);
345
- var dateLeft = toDate(dirtyDateLeft);
346
- var dateRight = toDate(dirtyDateRight);
347
- var sign = compareAsc(dateLeft, dateRight);
348
- var difference = Math.abs(differenceInCalendarYears(dateLeft, dateRight));
349
- dateLeft.setFullYear(1584);
350
- dateRight.setFullYear(1584);
351
- var isLastYearNotFull = compareAsc(dateLeft, dateRight) === -sign;
352
- var result = sign * (difference - Number(isLastYearNotFull));
353
- return result === 0 ? 0 : result;
354
- }
355
-
356
- // ../../node_modules/.pnpm/date-fns@2.30.0/node_modules/date-fns/esm/intervalToDuration/index.js
357
- function intervalToDuration(interval) {
358
- requiredArgs(1, arguments);
359
- var start = toDate(interval.start);
360
- var end = toDate(interval.end);
361
- if (isNaN(start.getTime())) throw new RangeError("Start Date is invalid");
362
- if (isNaN(end.getTime())) throw new RangeError("End Date is invalid");
363
- var duration = {};
364
- duration.years = Math.abs(differenceInYears(end, start));
365
- var sign = compareAsc(end, start);
366
- var remainingMonths = add(start, {
367
- years: sign * duration.years
368
- });
369
- duration.months = Math.abs(differenceInMonths(end, remainingMonths));
370
- var remainingDays = add(remainingMonths, {
371
- months: sign * duration.months
372
- });
373
- duration.days = Math.abs(differenceInDays(end, remainingDays));
374
- var remainingHours = add(remainingDays, {
375
- days: sign * duration.days
376
- });
377
- duration.hours = Math.abs(differenceInHours(end, remainingHours));
378
- var remainingMinutes = add(remainingHours, {
379
- hours: sign * duration.hours
380
- });
381
- duration.minutes = Math.abs(differenceInMinutes(end, remainingMinutes));
382
- var remainingSeconds = add(remainingMinutes, {
383
- minutes: sign * duration.minutes
384
- });
385
- duration.seconds = Math.abs(differenceInSeconds(end, remainingSeconds));
386
- return duration;
387
- }
34
+ var import_utc = require("@date-fns/utc");
35
+ var import_date_fns = require("date-fns");
388
36
 
389
37
  // src/guard.ts
390
38
  var createIsGuard = (type) => (value) => typeof value === type;
@@ -431,58 +79,35 @@ var formatTimestampShort = (timestamp, locale = void 0, timeZone = void 0) => ne
431
79
  var differenceInTimeAgo = (time, ago = true, endTime = (/* @__PURE__ */ new Date()).toISOString()) => {
432
80
  const end = new Date(endTime);
433
81
  const timeNumber = Date.parse(time);
434
- const seconds = differenceInSeconds(end, timeNumber);
82
+ const seconds = (0, import_date_fns.differenceInSeconds)(end, timeNumber);
435
83
  if (seconds < 60) return `${seconds} sec${ago ? " ago" : ""}`;
436
- const minutes = differenceInMinutes(end, timeNumber);
84
+ const minutes = (0, import_date_fns.differenceInMinutes)(end, timeNumber);
437
85
  if (minutes < 60) return `${minutes} min${ago ? " ago" : ""}`;
438
- const hours = differenceInHours(end, timeNumber);
86
+ const hours = (0, import_date_fns.differenceInHours)(end, timeNumber);
439
87
  if (hours < 48) return `${hours} ${pluralize("hour", hours)}${ago ? " ago" : ""}`;
440
- const days = differenceInDays(end, timeNumber);
88
+ const days = (0, import_date_fns.differenceInDays)(end, timeNumber);
441
89
  return `${days} days${ago ? " ago" : ""}`;
442
90
  };
443
91
  var intervalToDurationWords = (interval) => {
444
92
  if (isNullish(interval.start) || isNullish(interval.end)) return "??";
445
93
  if (interval.end === 0) return "??";
446
- const duration = intervalToDuration(interval);
94
+ const duration = (0, import_date_fns.intervalToDuration)(interval);
447
95
  if (duration.months) return ">1 month";
448
96
  if (duration.days) {
449
97
  return `${pad(duration.days)}${duration.days === 1 ? "day" : "days"} ${pad(
450
- duration.hours
451
- )}h ${pad(duration.minutes)}min ${pad(duration.seconds)}s`;
98
+ duration.hours ?? 0
99
+ )}h ${pad(duration.minutes ?? 0)}min ${pad(duration.seconds ?? 0)}s`;
452
100
  }
453
101
  if (duration.hours) {
454
- return `${pad(duration.hours)}h ${pad(duration.minutes)}min ${pad(duration.seconds)}s`;
102
+ return `${pad(duration.hours)}h ${pad(duration.minutes ?? 0)}min ${pad(duration.seconds ?? 0)}s`;
455
103
  }
456
- if (duration.minutes) return `${pad(duration.minutes)}min ${pad(duration.seconds)}s`;
104
+ if (duration.minutes) return `${pad(duration.minutes)}min ${pad(duration.seconds ?? 0)}s`;
457
105
  if (duration.seconds) return `${pad(duration.seconds)}s`;
458
- return "??";
459
- };
460
- var getUTCDateParts = (date) => {
461
- const day = date.getUTCDate().toString().padStart(2, "0");
462
- const month = (date.getUTCMonth() + 1).toString().padStart(2, "0");
463
- const year = date.getUTCFullYear().toString().padStart(4, "0");
464
- return { day, month, year };
465
- };
466
- var toStartOfUtcDayString = (date) => {
467
- const { day, month, year } = getUTCDateParts(date);
468
- return `${year}-${month}-${day}T00:00:00.000Z`;
469
- };
470
- var toEndOfUtcDayString = (date) => {
471
- const { day, month, year } = getUTCDateParts(date);
472
- return `${year}-${month}-${day}T23:59:59.999Z`;
473
- };
474
- var eachUtcDayOfInterval = ({ start, end }) => {
475
- let accumulator = start;
476
- const days = [];
477
- while (end >= accumulator) {
478
- if (new Date(toStartOfUtcDayString(accumulator)).getTime() > (/* @__PURE__ */ new Date()).getTime()) {
479
- break;
480
- }
481
- days.push(new Date(toStartOfUtcDayString(accumulator)));
482
- accumulator = addHours(accumulator, 24);
483
- }
484
- return days;
106
+ return "A few seconds";
485
107
  };
108
+ var toStartOfUtcDayString = (date) => (0, import_date_fns.startOfDay)(date, { in: import_utc.utc }).toISOString();
109
+ var toEndOfUtcDayString = (date) => (0, import_date_fns.endOfDay)(date, { in: import_utc.utc }).toISOString();
110
+ var eachUtcDayOfInterval = (interval) => (0, import_date_fns.eachDayOfInterval)(interval, { in: import_utc.utc });
486
111
  // Annotate the CommonJS export names for ESM import in node:
487
112
  0 && (module.exports = {
488
113
  differenceInTimeAgo,
package/dist/date.d.cts CHANGED
@@ -1,3 +1,4 @@
1
+ import { UTCDate } from '@date-fns/utc';
1
2
  import { Interval } from 'date-fns';
2
3
 
3
4
  declare const toISODateString: (date: Date) => string;
@@ -8,9 +9,9 @@ declare const differenceInTimeAgo: (time: string, ago?: boolean, endTime?: strin
8
9
  declare const intervalToDurationWords: (interval: Interval) => string;
9
10
  declare const toStartOfUtcDayString: (date: Date) => string;
10
11
  declare const toEndOfUtcDayString: (date: Date) => string;
11
- declare const eachUtcDayOfInterval: ({ start, end }: {
12
+ declare const eachUtcDayOfInterval: (interval: {
12
13
  start: Date;
13
14
  end: Date;
14
- }) => Date[];
15
+ }) => UTCDate[];
15
16
 
16
17
  export { differenceInTimeAgo, eachUtcDayOfInterval, formatTimestamp, formatTimestampShort, fromUnixTime, intervalToDurationWords, toEndOfUtcDayString, toISODateString, toStartOfUtcDayString };
package/dist/date.d.ts CHANGED
@@ -1,3 +1,4 @@
1
+ import { UTCDate } from '@date-fns/utc';
1
2
  import { Interval } from 'date-fns';
2
3
 
3
4
  declare const toISODateString: (date: Date) => string;
@@ -8,9 +9,9 @@ declare const differenceInTimeAgo: (time: string, ago?: boolean, endTime?: strin
8
9
  declare const intervalToDurationWords: (interval: Interval) => string;
9
10
  declare const toStartOfUtcDayString: (date: Date) => string;
10
11
  declare const toEndOfUtcDayString: (date: Date) => string;
11
- declare const eachUtcDayOfInterval: ({ start, end }: {
12
+ declare const eachUtcDayOfInterval: (interval: {
12
13
  start: Date;
13
14
  end: Date;
14
- }) => Date[];
15
+ }) => UTCDate[];
15
16
 
16
17
  export { differenceInTimeAgo, eachUtcDayOfInterval, formatTimestamp, formatTimestampShort, fromUnixTime, intervalToDurationWords, toEndOfUtcDayString, toISODateString, toStartOfUtcDayString };