yummies 3.0.32 → 3.0.33

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.
@@ -1,3 +1,3 @@
1
- export * from './modules-factory';
2
- export * from './counter';
1
+ export * from './modules-factory.js';
2
+ export * from './counter.js';
3
3
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/complex/index.ts"],"names":[],"mappings":"AAAA,cAAc,mBAAmB,CAAC;AAClC,cAAc,WAAW,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/complex/index.ts"],"names":[],"mappings":"AAAA,cAAc,sBAAsB,CAAC;AACrC,cAAc,cAAc,CAAC"}
package/complex/index.js CHANGED
@@ -1,2 +1,2 @@
1
- export * from './modules-factory';
2
- export * from './counter';
1
+ export * from './modules-factory.js';
2
+ export * from './counter.js';
package/date-time.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import dayjs from 'dayjs';
2
- import duration from 'dayjs/plugin/duration';
3
- import relativeTime from 'dayjs/plugin/relativeTime';
2
+ import duration from 'dayjs/plugin/duration.js';
3
+ import relativeTime from 'dayjs/plugin/relativeTime.js';
4
4
  import { unitsToMs } from './ms.js';
5
5
  import { declension } from './text.js';
6
6
  import { typeGuard } from './type-guard.js';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "yummies",
3
- "version": "3.0.32",
3
+ "version": "3.0.33",
4
4
  "keywords": [],
5
5
  "author": "js2me",
6
6
  "license": "MIT",
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=date-time.test.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"date-time.test.d.ts","sourceRoot":"","sources":["../src/date-time.test.ts"],"names":[],"mappings":""}
package/date-time.test.js DELETED
@@ -1,94 +0,0 @@
1
- import { describe, expect, test } from 'vitest';
2
- import { changeDate, dayTimeDuration, timeDuration, getFormatDuration, } from './date-time';
3
- import { unitsToMs } from './ms';
4
- describe('date-time', () => {
5
- describe('dayTimeDuration', () => {
6
- test('-1 minute', () => {
7
- expect(dayTimeDuration(-unitsToMs.min)).toStrictEqual({
8
- days: 0,
9
- hours: 0,
10
- seconds: 0,
11
- minutes: 0,
12
- milliseconds: 0,
13
- });
14
- });
15
- test('1 minute', () => {
16
- expect(dayTimeDuration(unitsToMs.min)).toStrictEqual({
17
- days: 0,
18
- hours: 0,
19
- seconds: 0,
20
- minutes: 1,
21
- milliseconds: 0,
22
- });
23
- });
24
- test('30 minutes 45 seconds', () => {
25
- expect(dayTimeDuration(unitsToMs.min * 30 + unitsToMs.sec * 45)).toStrictEqual({
26
- days: 0,
27
- hours: 0,
28
- seconds: 45,
29
- minutes: 30,
30
- milliseconds: 0,
31
- });
32
- });
33
- test('34 days 59 minutes 59 seconds', () => {
34
- expect(dayTimeDuration(34 * unitsToMs.day + unitsToMs.min * 59 + unitsToMs.sec * 59)).toStrictEqual({
35
- days: 34,
36
- hours: 0,
37
- minutes: 59,
38
- seconds: 59,
39
- milliseconds: 0,
40
- });
41
- });
42
- });
43
- describe('timeDuration', () => {
44
- test('-1 minute', () => {
45
- expect(timeDuration(-unitsToMs.min)).toStrictEqual({
46
- hours: 0,
47
- seconds: 0,
48
- minutes: 0,
49
- milliseconds: 0,
50
- });
51
- });
52
- test('1 minute', () => {
53
- expect(timeDuration(unitsToMs.min)).toStrictEqual({
54
- hours: 0,
55
- seconds: 0,
56
- minutes: 1,
57
- milliseconds: 0,
58
- });
59
- });
60
- test('30 minutes 45 seconds', () => {
61
- expect(timeDuration(unitsToMs.min * 30 + unitsToMs.sec * 45)).toStrictEqual({
62
- hours: 0,
63
- seconds: 45,
64
- minutes: 30,
65
- milliseconds: 0,
66
- });
67
- });
68
- test('34 days 59 minutes 59 seconds', () => {
69
- expect(timeDuration(34 * unitsToMs.day + unitsToMs.min * 59 + unitsToMs.sec * 59)).toStrictEqual({
70
- hours: 2_937_600_000,
71
- minutes: 59,
72
- seconds: 59,
73
- milliseconds: 0,
74
- });
75
- });
76
- });
77
- describe('getFormatDuration', () => {
78
- test('30 minutes', () => {
79
- const dateA = new Date(`2025-02-10T09:53:00.000Z`);
80
- const dateB = changeDate(dateA, 30, 'minutes');
81
- expect(getFormatDuration(dateA, dateB)).toBe('30 минут');
82
- });
83
- test('2 hours 45 minutes 10 seconds', () => {
84
- const dateA = new Date(`2025-02-10T09:53:00.000Z`);
85
- const dateB = changeDate(dateA, 2, 'hours', 45, 'minutes', 10, 'seconds');
86
- expect(getFormatDuration(dateA, dateB)).toBe('2 часа 45 минут 10 секунд');
87
- });
88
- test('2 hours 45 minutes 10 seconds (compact)', () => {
89
- const dateA = new Date(`2025-02-10T09:53:00.000Z`);
90
- const dateB = changeDate(dateA, 2, 'hours', 45, 'minutes', 10, 'seconds');
91
- expect(getFormatDuration(dateA, dateB, true)).toBe('2 ч 45 мин 10 сек');
92
- });
93
- });
94
- });