@herowcode/utils 1.5.2 → 1.5.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/api/{index.d.mts → index.d.cts} +1 -1
- package/dist/{chunk-UXEUYHBD.cjs → chunk-LN36GFUC.cjs} +12 -12
- package/dist/chunk-LN36GFUC.cjs.map +1 -0
- package/dist/{chunk-QRXVUXGJ.js → chunk-VQMAN6EZ.js} +12 -12
- package/dist/chunk-VQMAN6EZ.js.map +1 -0
- package/dist/date/index.cjs +13 -13
- package/dist/date/index.js +1 -1
- package/dist/download-url-BQ1RPHKW.d.cts +3 -0
- package/dist/download-url-BQ1RPHKW.d.ts +3 -0
- package/dist/{files/index.node.d.mts → file-exists-ZCP2yARf.d.cts} +1 -3
- package/dist/file-exists-ZCP2yARf.d.ts +5 -0
- package/dist/files/index.browser.cjs +9 -0
- package/dist/files/index.browser.cjs.map +1 -1
- package/dist/files/index.browser.d.cts +8 -0
- package/dist/files/index.browser.d.ts +5 -2
- package/dist/files/index.browser.js +11 -0
- package/dist/files/index.browser.js.map +1 -1
- package/dist/files/index.d.cts +3 -0
- package/dist/files/index.d.ts +2 -2
- package/dist/files/index.node.cjs +5 -1
- package/dist/files/index.node.cjs.map +1 -1
- package/dist/files/index.node.d.cts +6 -0
- package/dist/files/index.node.d.ts +3 -4
- package/dist/files/index.node.js +7 -0
- package/dist/files/index.node.js.map +1 -1
- package/dist/function/{index.d.mts → index.d.cts} +1 -1
- package/dist/index.cjs +13 -13
- package/dist/{index.d.mts → index.d.cts} +11 -11
- package/dist/index.d.ts +3 -3
- package/dist/index.js +1 -1
- package/dist/nextjs/index.d.cts +3 -0
- package/dist/{youtube/index.node.d.mts → validate-youtube-link-Bfr2jQY8.d.cts} +1 -1
- package/dist/validate-youtube-link-Bfr2jQY8.d.ts +49 -0
- package/dist/youtube/index.browser.d.cts +2 -0
- package/dist/youtube/index.browser.d.ts +1 -1
- package/dist/youtube/{index.d.mts → index.d.cts} +1 -1
- package/dist/youtube/index.d.ts +1 -1
- package/dist/youtube/index.node.cjs +10 -0
- package/dist/youtube/index.node.cjs.map +1 -1
- package/dist/youtube/index.node.d.cts +7 -0
- package/dist/youtube/index.node.d.ts +4 -46
- package/dist/youtube/index.node.js +12 -0
- package/dist/youtube/index.node.js.map +1 -1
- package/package.json +35 -33
- package/dist/chunk-QRXVUXGJ.js.map +0 -1
- package/dist/chunk-UXEUYHBD.cjs.map +0 -1
- package/dist/files/index.browser.d.mts +0 -5
- package/dist/files/index.d.mts +0 -3
- package/dist/nextjs/index.d.mts +0 -3
- package/dist/youtube/index.browser.d.mts +0 -2
- /package/dist/array/{index.d.mts → index.d.cts} +0 -0
- /package/dist/date/{index.d.mts → index.d.cts} +0 -0
- /package/dist/{format-bytes-B0QeE7As.d.mts → format-bytes-B0QeE7As.d.cts} +0 -0
- /package/dist/nextjs/{index.browser.d.mts → index.browser.d.cts} +0 -0
- /package/dist/string/{index.d.mts → index.d.cts} +0 -0
- /package/dist/{try-catch-B7WzqcPU.d.mts → try-catch-B7WzqcPU.d.cts} +0 -0
package/dist/index.js
CHANGED
|
@@ -5,7 +5,7 @@ export { camelCase, capitalize, formatHMSToSeconds, formatSecondsToFragment, for
|
|
|
5
5
|
export { extractYouTubeId } from './chunk-ATWN4SRX.js';
|
|
6
6
|
export { apiClient } from './chunk-2Y6M7IOG.js';
|
|
7
7
|
export { shuffle, unique } from './chunk-2RTW37WD.js';
|
|
8
|
-
export { dayjs, fixTimezoneOffset, formatDate, getCurrentDateInUTC, getDateInUTC, getDayjsGlobalIntl, getRelativeTime, parseTimeSpent, resetDayjsGlobalIntl, resolveDayjsIntlConfig, setDayjsGlobalIntl, withDayjsGlobalIntl } from './chunk-
|
|
8
|
+
export { dayjs, fixTimezoneOffset, formatDate, getCurrentDateInUTC, getDateInUTC, getDayjsGlobalIntl, getRelativeTime, parseTimeSpent, resetDayjsGlobalIntl, resolveDayjsIntlConfig, setDayjsGlobalIntl, withDayjsGlobalIntl } from './chunk-VQMAN6EZ.js';
|
|
9
9
|
import './chunk-3JUB2OJL.js';
|
|
10
10
|
export { downloadUrl } from './chunk-6IYD4APX.js';
|
|
11
11
|
export { fileDelete, fileExists } from './chunk-V6OKXUBQ.js';
|
|
@@ -46,4 +46,4 @@ declare function getYoutubeVideoInfo(videoUrl: string): Promise<TYouTubeVideoInf
|
|
|
46
46
|
|
|
47
47
|
declare function validateYoutubeLink(videoUrl: string): Promise<boolean>;
|
|
48
48
|
|
|
49
|
-
export { type TYouTubeVideoInfo, extractYouTubeId, generateYoutubeURL
|
|
49
|
+
export { type TYouTubeVideoInfo as T, getYoutubeVideoInfo as a, extractYouTubeId as e, generateYoutubeURL as g, validateYoutubeLink as v };
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
declare function extractYouTubeId(urlString: string | null): string | null;
|
|
2
|
+
|
|
3
|
+
type TCreateYoutubeLinkOptions = {
|
|
4
|
+
videoURL: string;
|
|
5
|
+
start?: number | string;
|
|
6
|
+
end?: number | string;
|
|
7
|
+
embed?: boolean;
|
|
8
|
+
short?: boolean;
|
|
9
|
+
useFragment?: boolean;
|
|
10
|
+
autoplay?: boolean;
|
|
11
|
+
controls?: 0 | 1;
|
|
12
|
+
rel?: 0 | 1;
|
|
13
|
+
loop?: boolean;
|
|
14
|
+
mute?: boolean;
|
|
15
|
+
modestbranding?: 0 | 1;
|
|
16
|
+
origin?: string;
|
|
17
|
+
playlist?: string;
|
|
18
|
+
params?: Record<string, string | number | boolean>;
|
|
19
|
+
};
|
|
20
|
+
declare const generateYoutubeURL: (opts: TCreateYoutubeLinkOptions) => string | null;
|
|
21
|
+
|
|
22
|
+
type TYtThumbnail = {
|
|
23
|
+
url: string;
|
|
24
|
+
width?: number;
|
|
25
|
+
height?: number;
|
|
26
|
+
};
|
|
27
|
+
type TYouTubeVideoInfo = {
|
|
28
|
+
id: string;
|
|
29
|
+
url: string;
|
|
30
|
+
title: string;
|
|
31
|
+
channelTitle: string;
|
|
32
|
+
channelId?: string;
|
|
33
|
+
channelUrl?: string;
|
|
34
|
+
description?: string;
|
|
35
|
+
shortDescription?: string;
|
|
36
|
+
thumbnails: TYtThumbnail[];
|
|
37
|
+
thumbnail?: string;
|
|
38
|
+
publishedAt?: string;
|
|
39
|
+
uploadedAt?: string;
|
|
40
|
+
keywords?: string[];
|
|
41
|
+
viewCount?: number;
|
|
42
|
+
lengthSeconds?: number;
|
|
43
|
+
isLive?: boolean;
|
|
44
|
+
};
|
|
45
|
+
declare function getYoutubeVideoInfo(videoUrl: string): Promise<TYouTubeVideoInfo | null>;
|
|
46
|
+
|
|
47
|
+
declare function validateYoutubeLink(videoUrl: string): Promise<boolean>;
|
|
48
|
+
|
|
49
|
+
export { type TYouTubeVideoInfo as T, getYoutubeVideoInfo as a, extractYouTubeId as e, generateYoutubeURL as g, validateYoutubeLink as v };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { TYouTubeVideoInfo, extractYouTubeId, generateYoutubeURL, getYoutubeVideoInfo, validateYoutubeLink } from '
|
|
1
|
+
export { T as TYouTubeVideoInfo, e as extractYouTubeId, g as generateYoutubeURL, a as getYoutubeVideoInfo, v as validateYoutubeLink } from '../validate-youtube-link-Bfr2jQY8.js';
|
|
2
2
|
export { getYoutubeThumbnail, getYoutubeVideoDuration } from './index.js';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { TYouTubeVideoInfo, extractYouTubeId, generateYoutubeURL, getYoutubeVideoInfo, validateYoutubeLink } from '
|
|
1
|
+
export { T as TYouTubeVideoInfo, e as extractYouTubeId, g as generateYoutubeURL, a as getYoutubeVideoInfo, v as validateYoutubeLink } from '../validate-youtube-link-Bfr2jQY8.cjs';
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* getYoutubeVideoDuration
|
package/dist/youtube/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { TYouTubeVideoInfo, extractYouTubeId, generateYoutubeURL, getYoutubeVideoInfo, validateYoutubeLink } from '
|
|
1
|
+
export { T as TYouTubeVideoInfo, e as extractYouTubeId, g as generateYoutubeURL, a as getYoutubeVideoInfo, v as validateYoutubeLink } from '../validate-youtube-link-Bfr2jQY8.js';
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* getYoutubeVideoDuration
|
|
@@ -4,7 +4,15 @@ var chunk5YOEKMTJ_cjs = require('../chunk-5YOEKMTJ.cjs');
|
|
|
4
4
|
require('../chunk-HK727IAV.cjs');
|
|
5
5
|
var chunkVAZJXZU5_cjs = require('../chunk-VAZJXZU5.cjs');
|
|
6
6
|
|
|
7
|
+
// src/youtube/get-video-duration-node-fallback.ts
|
|
8
|
+
async function getYoutubeVideoDuration(_videoUrl) {
|
|
9
|
+
return null;
|
|
10
|
+
}
|
|
7
11
|
|
|
12
|
+
// src/youtube/get-youtube-thumbnail-node-fallback.ts
|
|
13
|
+
async function getYoutubeThumbnail(_videoUrl) {
|
|
14
|
+
return null;
|
|
15
|
+
}
|
|
8
16
|
|
|
9
17
|
Object.defineProperty(exports, "generateYoutubeURL", {
|
|
10
18
|
enumerable: true,
|
|
@@ -22,5 +30,7 @@ Object.defineProperty(exports, "extractYouTubeId", {
|
|
|
22
30
|
enumerable: true,
|
|
23
31
|
get: function () { return chunkVAZJXZU5_cjs.extractYouTubeId; }
|
|
24
32
|
});
|
|
33
|
+
exports.getYoutubeThumbnail = getYoutubeThumbnail;
|
|
34
|
+
exports.getYoutubeVideoDuration = getYoutubeVideoDuration;
|
|
25
35
|
//# sourceMappingURL=index.node.cjs.map
|
|
26
36
|
//# sourceMappingURL=index.node.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":[],"names":[],"mappings":"","file":"index.node.cjs"}
|
|
1
|
+
{"version":3,"sources":["../../src/youtube/get-video-duration-node-fallback.ts","../../src/youtube/get-youtube-thumbnail-node-fallback.ts"],"names":[],"mappings":";;;;;;;AAAA,eAAsB,wBACpB,SAAA,EACwB;AACxB,EAAA,OAAO,IAAA;AACT;;;ACJA,eAAsB,oBACpB,SAAA,EACwB;AACxB,EAAA,OAAO,IAAA;AACT","file":"index.node.cjs","sourcesContent":["export async function getYoutubeVideoDuration(\n _videoUrl: string,\n): Promise<string | null> {\n return null\n}\n","export async function getYoutubeThumbnail(\n _videoUrl: string,\n): Promise<string | null> {\n return null\n}\n"]}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export { T as TYouTubeVideoInfo, e as extractYouTubeId, g as generateYoutubeURL, a as getYoutubeVideoInfo, v as validateYoutubeLink } from '../validate-youtube-link-Bfr2jQY8.cjs';
|
|
2
|
+
|
|
3
|
+
declare function getYoutubeVideoDuration(_videoUrl: string): Promise<string | null>;
|
|
4
|
+
|
|
5
|
+
declare function getYoutubeThumbnail(_videoUrl: string): Promise<string | null>;
|
|
6
|
+
|
|
7
|
+
export { getYoutubeThumbnail, getYoutubeVideoDuration };
|
|
@@ -1,49 +1,7 @@
|
|
|
1
|
-
|
|
1
|
+
export { T as TYouTubeVideoInfo, e as extractYouTubeId, g as generateYoutubeURL, a as getYoutubeVideoInfo, v as validateYoutubeLink } from '../validate-youtube-link-Bfr2jQY8.js';
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
videoURL: string;
|
|
5
|
-
start?: number | string;
|
|
6
|
-
end?: number | string;
|
|
7
|
-
embed?: boolean;
|
|
8
|
-
short?: boolean;
|
|
9
|
-
useFragment?: boolean;
|
|
10
|
-
autoplay?: boolean;
|
|
11
|
-
controls?: 0 | 1;
|
|
12
|
-
rel?: 0 | 1;
|
|
13
|
-
loop?: boolean;
|
|
14
|
-
mute?: boolean;
|
|
15
|
-
modestbranding?: 0 | 1;
|
|
16
|
-
origin?: string;
|
|
17
|
-
playlist?: string;
|
|
18
|
-
params?: Record<string, string | number | boolean>;
|
|
19
|
-
};
|
|
20
|
-
declare const generateYoutubeURL: (opts: TCreateYoutubeLinkOptions) => string | null;
|
|
3
|
+
declare function getYoutubeVideoDuration(_videoUrl: string): Promise<string | null>;
|
|
21
4
|
|
|
22
|
-
|
|
23
|
-
url: string;
|
|
24
|
-
width?: number;
|
|
25
|
-
height?: number;
|
|
26
|
-
};
|
|
27
|
-
type TYouTubeVideoInfo = {
|
|
28
|
-
id: string;
|
|
29
|
-
url: string;
|
|
30
|
-
title: string;
|
|
31
|
-
channelTitle: string;
|
|
32
|
-
channelId?: string;
|
|
33
|
-
channelUrl?: string;
|
|
34
|
-
description?: string;
|
|
35
|
-
shortDescription?: string;
|
|
36
|
-
thumbnails: TYtThumbnail[];
|
|
37
|
-
thumbnail?: string;
|
|
38
|
-
publishedAt?: string;
|
|
39
|
-
uploadedAt?: string;
|
|
40
|
-
keywords?: string[];
|
|
41
|
-
viewCount?: number;
|
|
42
|
-
lengthSeconds?: number;
|
|
43
|
-
isLive?: boolean;
|
|
44
|
-
};
|
|
45
|
-
declare function getYoutubeVideoInfo(videoUrl: string): Promise<TYouTubeVideoInfo | null>;
|
|
5
|
+
declare function getYoutubeThumbnail(_videoUrl: string): Promise<string | null>;
|
|
46
6
|
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
export { type TYouTubeVideoInfo, extractYouTubeId, generateYoutubeURL, getYoutubeVideoInfo, validateYoutubeLink };
|
|
7
|
+
export { getYoutubeThumbnail, getYoutubeVideoDuration };
|
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
export { generateYoutubeURL, getYoutubeVideoInfo, validateYoutubeLink } from '../chunk-QAE6Q2SA.js';
|
|
2
2
|
import '../chunk-53JMVGIG.js';
|
|
3
3
|
export { extractYouTubeId } from '../chunk-ATWN4SRX.js';
|
|
4
|
+
|
|
5
|
+
// src/youtube/get-video-duration-node-fallback.ts
|
|
6
|
+
async function getYoutubeVideoDuration(_videoUrl) {
|
|
7
|
+
return null;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
// src/youtube/get-youtube-thumbnail-node-fallback.ts
|
|
11
|
+
async function getYoutubeThumbnail(_videoUrl) {
|
|
12
|
+
return null;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
export { getYoutubeThumbnail, getYoutubeVideoDuration };
|
|
4
16
|
//# sourceMappingURL=index.node.js.map
|
|
5
17
|
//# sourceMappingURL=index.node.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":[],"names":[],"mappings":"","file":"index.node.js"}
|
|
1
|
+
{"version":3,"sources":["../../src/youtube/get-video-duration-node-fallback.ts","../../src/youtube/get-youtube-thumbnail-node-fallback.ts"],"names":[],"mappings":";;;;;AAAA,eAAsB,wBACpB,SAAA,EACwB;AACxB,EAAA,OAAO,IAAA;AACT;;;ACJA,eAAsB,oBACpB,SAAA,EACwB;AACxB,EAAA,OAAO,IAAA;AACT","file":"index.node.js","sourcesContent":["export async function getYoutubeVideoDuration(\n _videoUrl: string,\n): Promise<string | null> {\n return null\n}\n","export async function getYoutubeThumbnail(\n _videoUrl: string,\n): Promise<string | null> {\n return null\n}\n"]}
|
package/package.json
CHANGED
|
@@ -1,148 +1,149 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@herowcode/utils",
|
|
3
|
-
"version": "1.5.
|
|
3
|
+
"version": "1.5.3",
|
|
4
4
|
"description": "A lightweight collection of utility functions for everyday JavaScript/TypeScript development",
|
|
5
|
+
"type": "module",
|
|
5
6
|
"main": "dist/index.cjs",
|
|
6
7
|
"module": "dist/index.js",
|
|
7
8
|
"types": "dist/index.d.ts",
|
|
8
9
|
"exports": {
|
|
9
10
|
".": {
|
|
10
11
|
"import": {
|
|
11
|
-
"types": "./dist/index.d.
|
|
12
|
+
"types": "./dist/index.d.ts",
|
|
12
13
|
"default": "./dist/index.js"
|
|
13
14
|
},
|
|
14
15
|
"require": {
|
|
15
|
-
"types": "./dist/index.d.
|
|
16
|
+
"types": "./dist/index.d.cts",
|
|
16
17
|
"default": "./dist/index.cjs"
|
|
17
18
|
}
|
|
18
19
|
},
|
|
19
20
|
"./api": {
|
|
20
21
|
"import": {
|
|
21
|
-
"types": "./dist/api/index.d.
|
|
22
|
+
"types": "./dist/api/index.d.ts",
|
|
22
23
|
"default": "./dist/api/index.js"
|
|
23
24
|
},
|
|
24
25
|
"require": {
|
|
25
|
-
"types": "./dist/api/index.d.
|
|
26
|
+
"types": "./dist/api/index.d.cts",
|
|
26
27
|
"default": "./dist/api/index.cjs"
|
|
27
28
|
}
|
|
28
29
|
},
|
|
29
30
|
"./array": {
|
|
30
31
|
"import": {
|
|
31
|
-
"types": "./dist/array/index.d.
|
|
32
|
+
"types": "./dist/array/index.d.ts",
|
|
32
33
|
"default": "./dist/array/index.js"
|
|
33
34
|
},
|
|
34
35
|
"require": {
|
|
35
|
-
"types": "./dist/array/index.d.
|
|
36
|
+
"types": "./dist/array/index.d.cts",
|
|
36
37
|
"default": "./dist/array/index.cjs"
|
|
37
38
|
}
|
|
38
39
|
},
|
|
39
40
|
"./date": {
|
|
40
41
|
"import": {
|
|
41
|
-
"types": "./dist/date/index.d.
|
|
42
|
+
"types": "./dist/date/index.d.ts",
|
|
42
43
|
"default": "./dist/date/index.js"
|
|
43
44
|
},
|
|
44
45
|
"require": {
|
|
45
|
-
"types": "./dist/date/index.d.
|
|
46
|
+
"types": "./dist/date/index.d.cts",
|
|
46
47
|
"default": "./dist/date/index.cjs"
|
|
47
48
|
}
|
|
48
49
|
},
|
|
49
50
|
"./files": {
|
|
50
51
|
"browser": {
|
|
51
52
|
"import": {
|
|
52
|
-
"types": "./dist/files/index.browser.d.
|
|
53
|
+
"types": "./dist/files/index.browser.d.ts",
|
|
53
54
|
"default": "./dist/files/index.browser.js"
|
|
54
55
|
},
|
|
55
56
|
"require": {
|
|
56
|
-
"types": "./dist/files/index.browser.d.
|
|
57
|
+
"types": "./dist/files/index.browser.d.cts",
|
|
57
58
|
"default": "./dist/files/index.browser.cjs"
|
|
58
59
|
}
|
|
59
60
|
},
|
|
60
61
|
"node": {
|
|
61
62
|
"import": {
|
|
62
|
-
"types": "./dist/files/index.node.d.
|
|
63
|
+
"types": "./dist/files/index.node.d.ts",
|
|
63
64
|
"default": "./dist/files/index.node.js"
|
|
64
65
|
},
|
|
65
66
|
"require": {
|
|
66
|
-
"types": "./dist/files/index.node.d.
|
|
67
|
+
"types": "./dist/files/index.node.d.cts",
|
|
67
68
|
"default": "./dist/files/index.node.cjs"
|
|
68
69
|
}
|
|
69
70
|
},
|
|
70
71
|
"import": {
|
|
71
|
-
"types": "./dist/files/index.d.
|
|
72
|
+
"types": "./dist/files/index.d.ts",
|
|
72
73
|
"default": "./dist/files/index.js"
|
|
73
74
|
},
|
|
74
75
|
"require": {
|
|
75
|
-
"types": "./dist/files/index.d.
|
|
76
|
+
"types": "./dist/files/index.d.cts",
|
|
76
77
|
"default": "./dist/files/index.cjs"
|
|
77
78
|
}
|
|
78
79
|
},
|
|
79
80
|
"./function": {
|
|
80
81
|
"import": {
|
|
81
|
-
"types": "./dist/function/index.d.
|
|
82
|
+
"types": "./dist/function/index.d.ts",
|
|
82
83
|
"default": "./dist/function/index.js"
|
|
83
84
|
},
|
|
84
85
|
"require": {
|
|
85
|
-
"types": "./dist/function/index.d.
|
|
86
|
+
"types": "./dist/function/index.d.cts",
|
|
86
87
|
"default": "./dist/function/index.cjs"
|
|
87
88
|
}
|
|
88
89
|
},
|
|
89
90
|
"./nextjs": {
|
|
90
91
|
"browser": {
|
|
91
92
|
"import": {
|
|
92
|
-
"types": "./dist/nextjs/index.browser.d.
|
|
93
|
+
"types": "./dist/nextjs/index.browser.d.ts",
|
|
93
94
|
"default": "./dist/nextjs/index.browser.js"
|
|
94
95
|
},
|
|
95
96
|
"require": {
|
|
96
|
-
"types": "./dist/nextjs/index.browser.d.
|
|
97
|
+
"types": "./dist/nextjs/index.browser.d.cts",
|
|
97
98
|
"default": "./dist/nextjs/index.browser.cjs"
|
|
98
99
|
}
|
|
99
100
|
},
|
|
100
101
|
"import": {
|
|
101
|
-
"types": "./dist/nextjs/index.d.
|
|
102
|
+
"types": "./dist/nextjs/index.d.ts",
|
|
102
103
|
"default": "./dist/nextjs/index.js"
|
|
103
104
|
},
|
|
104
105
|
"require": {
|
|
105
|
-
"types": "./dist/nextjs/index.d.
|
|
106
|
+
"types": "./dist/nextjs/index.d.cts",
|
|
106
107
|
"default": "./dist/nextjs/index.cjs"
|
|
107
108
|
}
|
|
108
109
|
},
|
|
109
110
|
"./string": {
|
|
110
111
|
"import": {
|
|
111
|
-
"types": "./dist/string/index.d.
|
|
112
|
+
"types": "./dist/string/index.d.ts",
|
|
112
113
|
"default": "./dist/string/index.js"
|
|
113
114
|
},
|
|
114
115
|
"require": {
|
|
115
|
-
"types": "./dist/string/index.d.
|
|
116
|
+
"types": "./dist/string/index.d.cts",
|
|
116
117
|
"default": "./dist/string/index.cjs"
|
|
117
118
|
}
|
|
118
119
|
},
|
|
119
120
|
"./youtube": {
|
|
120
121
|
"browser": {
|
|
121
122
|
"import": {
|
|
122
|
-
"types": "./dist/youtube/index.browser.d.
|
|
123
|
+
"types": "./dist/youtube/index.browser.d.ts",
|
|
123
124
|
"default": "./dist/youtube/index.browser.js"
|
|
124
125
|
},
|
|
125
126
|
"require": {
|
|
126
|
-
"types": "./dist/youtube/index.browser.d.
|
|
127
|
+
"types": "./dist/youtube/index.browser.d.cts",
|
|
127
128
|
"default": "./dist/youtube/index.browser.cjs"
|
|
128
129
|
}
|
|
129
130
|
},
|
|
130
131
|
"node": {
|
|
131
132
|
"import": {
|
|
132
|
-
"types": "./dist/youtube/index.node.d.
|
|
133
|
+
"types": "./dist/youtube/index.node.d.ts",
|
|
133
134
|
"default": "./dist/youtube/index.node.js"
|
|
134
135
|
},
|
|
135
136
|
"require": {
|
|
136
|
-
"types": "./dist/youtube/index.node.d.
|
|
137
|
+
"types": "./dist/youtube/index.node.d.cts",
|
|
137
138
|
"default": "./dist/youtube/index.node.cjs"
|
|
138
139
|
}
|
|
139
140
|
},
|
|
140
141
|
"import": {
|
|
141
|
-
"types": "./dist/youtube/index.d.
|
|
142
|
+
"types": "./dist/youtube/index.d.ts",
|
|
142
143
|
"default": "./dist/youtube/index.js"
|
|
143
144
|
},
|
|
144
145
|
"require": {
|
|
145
|
-
"types": "./dist/youtube/index.d.
|
|
146
|
+
"types": "./dist/youtube/index.d.cts",
|
|
146
147
|
"default": "./dist/youtube/index.cjs"
|
|
147
148
|
}
|
|
148
149
|
}
|
|
@@ -156,11 +157,12 @@
|
|
|
156
157
|
"test": "vitest",
|
|
157
158
|
"test:ui": "vitest --ui",
|
|
158
159
|
"test:run": "vitest run",
|
|
160
|
+
"test:exports": "node scripts/verify-exports.cjs",
|
|
159
161
|
"test:coverage": "vitest run --coverage",
|
|
160
|
-
"prepublishOnly": "pnpm lint && pnpm test:run && pnpm build",
|
|
161
|
-
"version:patch": "pnpm lint && pnpm test:run && pnpm build && npm version patch && git push && git push --tags",
|
|
162
|
-
"version:minor": "pnpm lint && pnpm test:run && pnpm build && npm version minor && git push && git push --tags",
|
|
163
|
-
"version:major": "pnpm lint && pnpm test:run && pnpm build && npm version major && git push && git push --tags"
|
|
162
|
+
"prepublishOnly": "pnpm lint && pnpm test:run && pnpm build && pnpm test:exports",
|
|
163
|
+
"version:patch": "pnpm lint && pnpm test:run && pnpm build && pnpm test:exports && npm version patch && git push && git push --tags",
|
|
164
|
+
"version:minor": "pnpm lint && pnpm test:run && pnpm build && pnpm test:exports && npm version minor && git push && git push --tags",
|
|
165
|
+
"version:major": "pnpm lint && pnpm test:run && pnpm build && pnpm test:exports && npm version major && git push && git push --tags"
|
|
164
166
|
},
|
|
165
167
|
"keywords": [
|
|
166
168
|
"utils",
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/date/dayjs.ts","../src/date/fix-timezone-offset.ts","../src/date/format-date.ts","../src/date/get-current-date-in-utc.ts","../src/date/get-date-in-utc.ts","../src/date/get-relative-time.ts","../src/date/parse-time-spent.ts"],"names":["formatIntl","toIntlFormatter","workingInstance","intlConfig"],"mappings":";;;;;;;;;;;;;AAyBA,IAAM,mBAAA,GAAgD;AAAA,EACpD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S,MAAA,KAAT,IAAA,GAAA,EAAA,GAAmB,SAAA;AAClC,EAAA,MAAM,OAAA,GAAA,CAAU,EAAA,GAAA,OAAA,IAAA,IAAA,GAAA,MAAA,GAAA,OAAA,CAAS,OAAA,KAAT,IAAA,GAAA,EAAA,GAAoB,KAAA;AAEpC,EAAA,IAAI,SAAA,GAAY,EAAA;AAChB,EAAA,IAAI,WAAW,SAAA,EAAW;AACxB,IAAA,IAAI,aAAA,CAAc,WAAW,CAAA,EAAG;AAC9B,MAAA,SAAA,GAAY,EAAA;AAAA,IACd,WAAW,OAAA,EAAS;AAClB,MAAA,SAAA,GAAY,cAAc,CAAC,CAAA;AAAA,IAC7B,CAAA,MAAO;AACL,MAAA,SAAA,GAAY,aAAA,CAAc,KAAK,EAAE,CAAA;AAAA,IACnC;AAAA,EACF,CAAA,MAAO;AAEL,IAAA,IAAI,YAAA,CAAa,WAAW,CAAA,EAAG;AAC7B,MAAA,SAAA,GAAY,EAAA;AAAA,IACd,WAAW,OAAA,EAAS;AAClB,MAAA,SAAA,GAAY,aAAa,CAAC,CAAA;AAAA,IAC5B,CAAA,MAAO;AACL,MAAA,SAAA,GAAY,YAAA,CAAa,WAAW,YAAY,CAAA;AAAA,IAClD;AAAA,EACF;AAEA,EAAA,OAAO;AAAA,IACL,KAAA;AAAA,IACA,MAAA;AAAA,IACA,IAAA;AAAA,IACA,KAAA;AAAA,IACA,OAAA;AAAA,IACA,OAAA;AAAA,IACA;AAAA,GACF;AACF","file":"chunk-QRXVUXGJ.js","sourcesContent":["import type { Dayjs as DayjsInstance, PluginFunc } from \"dayjs\"\nimport dayJs from \"dayjs\"\nimport advancedFormat from \"dayjs/plugin/advancedFormat\"\nimport customParseFormat from \"dayjs/plugin/customParseFormat\"\nimport localizedFormat from \"dayjs/plugin/localizedFormat\"\nimport relativeTime from \"dayjs/plugin/relativeTime\"\nimport timezone from \"dayjs/plugin/timezone\"\nimport utc from \"dayjs/plugin/utc\"\nimport \"dayjs/locale/en\"\nimport \"dayjs/locale/es\"\nimport \"dayjs/locale/fr\"\nimport \"dayjs/locale/pt-br\"\n// Ensure TS sees Dayjs instance augmentation wherever this module is imported\nimport type {} from \"../types/dayjs-intl\"\n\nexport interface IDayjsIntlConfig {\n locale?: Intl.LocalesArgument\n options?: Intl.DateTimeFormatOptions\n}\n\nexport interface IDayjsIntlResolvedConfig {\n locale: Intl.LocalesArgument\n options: Intl.DateTimeFormatOptions\n}\n\nconst DEFAULT_INTL_CONFIG: IDayjsIntlResolvedConfig = {\n locale: \"pt-BR\",\n options: {\n month: \"long\",\n day: \"numeric\",\n year: \"numeric\",\n },\n}\n\nlet globalIntlConfig: IDayjsIntlResolvedConfig = {\n locale: DEFAULT_INTL_CONFIG.locale,\n options: { ...DEFAULT_INTL_CONFIG.options },\n}\n\nfunction mergeIntlConfigs(\n base: IDayjsIntlResolvedConfig,\n override?: IDayjsIntlConfig,\n): IDayjsIntlResolvedConfig {\n if (!override) {\n return {\n locale: base.locale,\n options: { ...base.options },\n }\n }\n\n const mergedLocale = override.locale ?? base.locale\n const mergedOptions: Intl.DateTimeFormatOptions = { ...base.options }\n\n if (override.options) {\n for (const key of Object.keys(override.options) as Array<\n keyof Intl.DateTimeFormatOptions\n >) {\n const value = override.options[key]\n\n if (value === undefined || value === null) {\n delete mergedOptions[key]\n } else {\n mergedOptions[key] = value as never\n }\n }\n }\n\n return {\n locale: mergedLocale,\n options: mergedOptions,\n }\n}\n\nconst intlPlugin: PluginFunc<IDayjsIntlConfig | undefined> = (\n pluginConfig,\n DayjsClass,\n) => {\n if (pluginConfig) {\n globalIntlConfig = mergeIntlConfigs(globalIntlConfig, pluginConfig)\n }\n\n const formatIntl = function formatIntl(\n this: DayjsInstance,\n config?: IDayjsIntlConfig,\n ): string {\n const resolved = mergeIntlConfigs(globalIntlConfig, config)\n return new Intl.DateTimeFormat(resolved.locale, resolved.options).format(\n this.toDate(),\n )\n }\n\n const toIntlFormatter = function toIntlFormatter(\n this: DayjsInstance,\n config?: IDayjsIntlConfig,\n ): Intl.DateTimeFormat {\n const resolved = mergeIntlConfigs(globalIntlConfig, config)\n return new Intl.DateTimeFormat(resolved.locale, resolved.options)\n }\n\n Object.defineProperty(DayjsClass.prototype, \"formatIntl\", {\n value: formatIntl,\n configurable: true,\n })\n\n Object.defineProperty(DayjsClass.prototype, \"toIntlFormatter\", {\n value: toIntlFormatter,\n configurable: true,\n })\n}\n\nexport function getDayjsGlobalIntl(): IDayjsIntlResolvedConfig {\n return {\n locale: globalIntlConfig.locale,\n options: { ...globalIntlConfig.options },\n }\n}\n\nexport function setDayjsGlobalIntl(\n config: IDayjsIntlConfig,\n): IDayjsIntlResolvedConfig {\n globalIntlConfig = mergeIntlConfigs(globalIntlConfig, config)\n return getDayjsGlobalIntl()\n}\n\nexport function resetDayjsGlobalIntl(): IDayjsIntlResolvedConfig {\n globalIntlConfig = {\n locale: DEFAULT_INTL_CONFIG.locale,\n options: { ...DEFAULT_INTL_CONFIG.options },\n }\n return getDayjsGlobalIntl()\n}\n\nexport function withDayjsGlobalIntl<T>(\n config: IDayjsIntlConfig,\n callback: () => T,\n): T {\n const previous = getDayjsGlobalIntl()\n globalIntlConfig = mergeIntlConfigs(globalIntlConfig, config)\n\n try {\n return callback()\n } finally {\n globalIntlConfig = {\n locale: previous.locale,\n options: { ...previous.options },\n }\n }\n}\n\nexport function resolveDayjsIntlConfig(\n config?: IDayjsIntlConfig,\n): IDayjsIntlResolvedConfig {\n return mergeIntlConfigs(globalIntlConfig, config)\n}\n\ndayJs.extend(utc)\ndayJs.extend(customParseFormat)\ndayJs.extend(advancedFormat)\ndayJs.extend(timezone)\ndayJs.extend(localizedFormat)\ndayJs.extend(relativeTime)\ndayJs.extend(intlPlugin)\n\nexport const dayjs = dayJs\n","import type { Dayjs } from \"dayjs\"\n\nimport { dayjs } from \"./dayjs\"\n\nexport function fixTimezoneOffset(utcDate: Date | string): Dayjs {\n const offset = new Date(utcDate).getTimezoneOffset()\n return dayjs(utcDate).add(offset, \"minute\")\n}\n","import type { IDayjsIntlConfig } from \"./dayjs\"\nimport { dayjs, getDayjsGlobalIntl } from \"./dayjs\"\n\nexport interface IFormatDateConfig {\n /** Optional locale override applied to the underlying dayjs instance */\n locale?: string\n /**\n * When provided, format using dayjs tokens (e.g. \"DD/MM/YYYY\").\n * Unless `useIntl` is true, this takes precedence over Intl formatting.\n */\n format?: string\n /**\n * Intl configuration used when formatting through `Intl.DateTimeFormat`.\n * Values are merged on top of the global Intl configuration.\n */\n intl?: IDayjsIntlConfig\n /**\n * Forces the use of Intl formatting even if a format string is supplied.\n */\n useIntl?: boolean\n}\n\ntype TLocaleOrConfig = Intl.LocalesArgument | IFormatDateConfig\n\nfunction isFormatDateConfig(\n value: TLocaleOrConfig,\n): value is IFormatDateConfig {\n return Boolean(value) && typeof value === \"object\" && !Array.isArray(value)\n}\n\nfunction isValidLocaleTag(value: string): boolean {\n if (\n typeof Intl !== \"undefined\" &&\n typeof Intl.getCanonicalLocales === \"function\"\n ) {\n try {\n Intl.getCanonicalLocales(value)\n return true\n } catch {\n return false\n }\n }\n\n return /^[a-z]{2,3}(?:-[A-Za-z0-9]{2,8})*$/.test(value)\n}\n\nfunction toDayjsLocale(\n locale?:\n | Intl.LocalesArgument\n | Intl.Locale\n | readonly (string | Intl.Locale)[],\n): string | undefined {\n if (!locale) return undefined\n const first = Array.isArray(locale)\n ? (locale[0] as string | Intl.Locale)\n : (locale as string | Intl.Locale)\n return typeof first === \"string\" ? first : String(first)\n}\n\nexport function formatDate(\n date: Date | string | number,\n localeOrConfig: TLocaleOrConfig = getDayjsGlobalIntl().locale,\n opts?: Intl.DateTimeFormatOptions,\n): string {\n const instance = dayjs(date)\n\n if (!instance.isValid()) {\n throw new RangeError(\"Invalid time value\")\n }\n\n if (isFormatDateConfig(localeOrConfig)) {\n const { format, locale, intl, useIntl } = localeOrConfig\n const baseLocale = locale ?? toDayjsLocale(intl?.locale)\n const workingInstance = baseLocale ? instance.locale(baseLocale) : instance\n\n if (format && !useIntl) {\n return workingInstance.format(format)\n }\n\n const intlConfig: IDayjsIntlConfig | undefined = intl\n ? {\n locale: intl.locale ?? baseLocale,\n options: intl.options,\n }\n : baseLocale\n ? {\n locale: baseLocale,\n }\n : undefined\n\n return workingInstance.formatIntl(intlConfig)\n }\n\n if (typeof localeOrConfig === \"string\" && opts === undefined) {\n if (!isValidLocaleTag(localeOrConfig)) {\n return instance.format(localeOrConfig)\n }\n }\n\n const localeForDayjs = toDayjsLocale(localeOrConfig)\n const workingInstance = localeForDayjs\n ? instance.locale(localeForDayjs)\n : instance\n\n const intlConfig: IDayjsIntlConfig | undefined =\n localeOrConfig !== undefined || opts !== undefined\n ? {\n locale: localeOrConfig,\n options: opts,\n }\n : undefined\n\n return workingInstance.formatIntl(intlConfig)\n}\n","import type { Dayjs } from \"dayjs\"\n\nimport { dayjs } from \"./dayjs\"\n\nexport function getCurrentDateInUTC(): Dayjs {\n return dayjs().utc()\n}\n","import type { Dayjs } from \"dayjs\"\n\nimport { dayjs } from \"./dayjs\"\n\nexport function getDateInUTC(date: Date): Dayjs {\n return dayjs(date).utc()\n}\n","import type { ConfigType } from \"dayjs\"\nimport { dayjs } from \"./dayjs\"\n\nexport function getRelativeTime(date: ConfigType, dateNow = dayjs()): string {\n return dayjs(date).from(dateNow)\n}\n","import { fixTimezoneOffset } from \"./fix-timezone-offset\"\n\ninterface IUnitTranslation {\n singular: string\n plural: string\n}\n\ninterface ILocaleTranslations {\n year: IUnitTranslation\n month: IUnitTranslation\n day: IUnitTranslation\n hour: IUnitTranslation\n minute: IUnitTranslation\n second: IUnitTranslation\n // function to format verbose list (e.g. \"1 ano, 2 meses e 3 dias\")\n formatList: (parts: string[]) => string\n // tokens used for compact formatting (e.g. \"1a2m3d\")\n compactTokens: {\n year: string\n month: string\n day: string\n hour: string\n minute: string\n second: string\n }\n}\n\n// Supported locales and their translations\nconst locales: Record<string, ILocaleTranslations> = {\n \"pt-BR\": {\n year: { singular: \"ano\", plural: \"anos\" },\n month: { singular: \"mês\", plural: \"meses\" },\n day: { singular: \"dia\", plural: \"dias\" },\n hour: { singular: \"hora\", plural: \"horas\" },\n minute: { singular: \"minuto\", plural: \"minutos\" },\n second: { singular: \"segundo\", plural: \"segundos\" },\n formatList: (parts) => {\n if (parts.length === 0) return \"\"\n if (parts.length === 1) return parts[0]\n const lastPart = parts[parts.length - 1]\n const otherParts = parts.slice(0, -1)\n return `${otherParts.join(\", \")} e ${lastPart}`\n },\n compactTokens: {\n year: \"a\",\n month: \"m\",\n day: \"d\",\n hour: \"h\",\n minute: \"min\",\n second: \"s\",\n },\n },\n \"en-US\": {\n year: { singular: \"year\", plural: \"years\" },\n month: { singular: \"month\", plural: \"months\" },\n day: { singular: \"day\", plural: \"days\" },\n hour: { singular: \"hour\", plural: \"hours\" },\n minute: { singular: \"minute\", plural: \"minutes\" },\n second: { singular: \"second\", plural: \"seconds\" },\n formatList: (parts) => {\n if (parts.length === 0) return \"\"\n if (parts.length === 1) return parts[0]\n if (parts.length === 2) return `${parts[0]} and ${parts[1]}`\n return `${parts.slice(0, -1).join(\", \")}, and ${parts[parts.length - 1]}`\n },\n compactTokens: {\n year: \"y\",\n month: \"mo\",\n day: \"d\",\n hour: \"h\",\n minute: \"m\",\n second: \"s\",\n },\n },\n \"es-ES\": {\n year: { singular: \"año\", plural: \"años\" },\n month: { singular: \"mes\", plural: \"meses\" },\n day: { singular: \"día\", plural: \"días\" },\n hour: { singular: \"hora\", plural: \"horas\" },\n minute: { singular: \"minuto\", plural: \"minutos\" },\n second: { singular: \"segundo\", plural: \"segundos\" },\n formatList: (parts) => {\n if (parts.length === 0) return \"\"\n if (parts.length === 1) return parts[0]\n const lastPart = parts[parts.length - 1]\n const otherParts = parts.slice(0, -1)\n return `${otherParts.join(\", \")} y ${lastPart}`\n },\n compactTokens: {\n year: \"a\",\n month: \"mes\",\n day: \"d\",\n hour: \"h\",\n minute: \"min\",\n second: \"s\",\n },\n },\n \"fr-FR\": {\n year: { singular: \"an\", plural: \"ans\" },\n month: { singular: \"mois\", plural: \"mois\" },\n day: { singular: \"jour\", plural: \"jours\" },\n hour: { singular: \"heure\", plural: \"heures\" },\n minute: { singular: \"minute\", plural: \"minutes\" },\n second: { singular: \"seconde\", plural: \"secondes\" },\n formatList: (parts) => {\n if (parts.length === 0) return \"\"\n if (parts.length === 1) return parts[0]\n const lastPart = parts[parts.length - 1]\n const otherParts = parts.slice(0, -1)\n return `${otherParts.join(\", \")} et ${lastPart}`\n },\n compactTokens: {\n year: \"a\",\n month: \"m\",\n day: \"j\",\n hour: \"h\",\n minute: \"min\",\n second: \"s\",\n },\n },\n}\n\n// Return shape\nexport interface ITimeSpent {\n years: number\n months: number\n days: number\n hours: number\n minutes: number\n seconds: number\n formatted: string\n}\n\n// options: format -> 'verbose' | 'compact', minimal -> show only largest non-zero unit\nexport function parseTimeSpent(\n initialDate: string | Date,\n finalDate: string | Date,\n locale = \"pt-BR\", // Default to Portuguese for backward compatibility\n options?: { format?: \"verbose\" | \"compact\"; minimal?: boolean },\n): ITimeSpent {\n const final = fixTimezoneOffset(finalDate)\n const initial = fixTimezoneOffset(initialDate)\n\n const years = final.diff(initial, \"year\")\n const months = final.diff(initial.add(years, \"year\"), \"month\")\n const days = final.diff(\n initial.add(years, \"year\").add(months, \"month\"),\n \"day\",\n )\n const hours = final.diff(\n initial.add(years, \"year\").add(months, \"month\").add(days, \"day\"),\n \"hour\",\n )\n const minutes = final.diff(\n initial\n .add(years, \"year\")\n .add(months, \"month\")\n .add(days, \"day\")\n .add(hours, \"hour\"),\n \"minute\",\n )\n const seconds = final.diff(\n initial\n .add(years, \"year\")\n .add(months, \"month\")\n .add(days, \"day\")\n .add(hours, \"hour\")\n .add(minutes, \"minute\"),\n \"second\",\n )\n\n // Use default locale if the requested one isn't supported\n const translations = locales[locale] || locales[\"pt-BR\"]\n\n // Build verbose parts (localized words)\n const verboseParts: string[] = []\n if (years > 0) {\n const unit =\n years === 1 ? translations.year.singular : translations.year.plural\n verboseParts.push(`${years} ${unit}`)\n }\n if (months > 0) {\n const unit =\n months === 1 ? translations.month.singular : translations.month.plural\n verboseParts.push(`${months} ${unit}`)\n }\n if (days > 0) {\n const unit =\n days === 1 ? translations.day.singular : translations.day.plural\n verboseParts.push(`${days} ${unit}`)\n }\n if (hours > 0) {\n const unit =\n hours === 1 ? translations.hour.singular : translations.hour.plural\n verboseParts.push(`${hours} ${unit}`)\n }\n if (minutes > 0) {\n const unit =\n minutes === 1 ? translations.minute.singular : translations.minute.plural\n verboseParts.push(`${minutes} ${unit}`)\n }\n if (seconds > 0) {\n const unit =\n seconds === 1 ? translations.second.singular : translations.second.plural\n verboseParts.push(`${seconds} ${unit}`)\n }\n\n // Build compact parts (e.g. \"1a2m3d\")\n const compactPieces: string[] = []\n if (years > 0)\n compactPieces.push(`${years}${translations.compactTokens.year}`)\n if (months > 0)\n compactPieces.push(`${months}${translations.compactTokens.month}`)\n if (days > 0) compactPieces.push(`${days}${translations.compactTokens.day}`)\n if (hours > 0)\n compactPieces.push(`${hours}${translations.compactTokens.hour}`)\n if (minutes > 0)\n compactPieces.push(`${minutes}${translations.compactTokens.minute}`)\n if (seconds > 0)\n compactPieces.push(`${seconds}${translations.compactTokens.second}`)\n\n const format = options?.format ?? \"verbose\"\n const minimal = options?.minimal ?? false\n\n let formatted = \"\"\n if (format === \"compact\") {\n if (compactPieces.length === 0) {\n formatted = \"\"\n } else if (minimal) {\n formatted = compactPieces[0]\n } else {\n formatted = compactPieces.join(\"\")\n }\n } else {\n // verbose\n if (verboseParts.length === 0) {\n formatted = \"\"\n } else if (minimal) {\n formatted = verboseParts[0]\n } else {\n formatted = translations.formatList(verboseParts)\n }\n }\n\n return {\n years,\n months,\n days,\n hours,\n minutes,\n seconds,\n formatted,\n }\n}\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/date/dayjs.ts","../src/date/fix-timezone-offset.ts","../src/date/format-date.ts","../src/date/get-current-date-in-utc.ts","../src/date/get-date-in-utc.ts","../src/date/get-relative-time.ts","../src/date/parse-time-spent.ts"],"names":["formatIntl","toIntlFormatter","dayJs","utc","customParseFormat","advancedFormat","timezone","localizedFormat","relativeTime","workingInstance","intlConfig"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAyBA,IAAM,mBAAA,GAAgD;AAAA,EACpD,MAAA,EAAQ,OAAA;AAAA,EACR,OAAA,EAAS;AAAA,IACP,KAAA,EAAO,MAAA;AAAA,IACP,GAAA,EAAK,SAAA;AAAA,IACL,IAAA,EAAM;AAAA;AAEV,CAAA;AAEA,IAAI,gBAAA,GAA6C;AAAA,EAC/C,QAAQ,mBAAA,CAAoB,MAAA;AAAA,EAC5B,OAAA,EAAS,EAAE,GAAG,mBAAA,CAAoB,OAAA;AACpC,CAAA;AAEA,SAAS,gBAAA,CACP,MACA,QAAA,EAC0B;AA1C5B,EAAA,IAAA,EAAA;AA2CE,EAAA,IAAI,CAAC,QAAA,EAAU;AACb,IAAA,OAAO;AAAA,MACL,QAAQ,IAAA,CAAK,MAAA;AAAA,MACb,OAAA,EAAS,EAAE,GAAG,IAAA,CAAK,OAAA;AAAQ,KAC7B;AAAA,EACF;AAEA,EAAA,MAAM,YAAA,GAAA,CAAe,EAAA,GAAA,QAAA,CAAS,MAAA,KAAT,IAAA,GAAA,EAAA,GAAmB,IAAA,CAAK,MAAA;AAC7C,EAAA,MAAM,aAAA,GAA4C,EAAE,GAAG,IAAA,CAAK,OAAA,EAAQ;AAEpE,EAAA,IAAI,SAAS,OAAA,EAAS;AACpB,IAAA,KAAA,MAAW,GAAA,IAAO,MAAA,CAAO,IAAA,CAAK,QAAA,CAAS,OAAO,CAAA,EAE3C;AACD,MAAA,MAAM,KAAA,GAAQ,QAAA,CAAS,OAAA,CAAQ,GAAG,CAAA;AAElC,MAAA,IAAI,KAAA,KAAU,MAAA,IAAa,KAAA,KAAU,IAAA,EAAM;AACzC,QAAA,OAAO,cAAc,GAAG,CAAA;AAAA,MAC1B,CAAA,MAAO;A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import dayJs from \"dayjs\"\nimport advancedFormat from \"dayjs/plugin/advancedFormat\"\nimport customParseFormat from \"dayjs/plugin/customParseFormat\"\nimport localizedFormat from \"dayjs/plugin/localizedFormat\"\nimport relativeTime from \"dayjs/plugin/relativeTime\"\nimport timezone from \"dayjs/plugin/timezone\"\nimport utc from \"dayjs/plugin/utc\"\nimport \"dayjs/locale/en\"\nimport \"dayjs/locale/es\"\nimport \"dayjs/locale/fr\"\nimport \"dayjs/locale/pt-br\"\n// Ensure TS sees Dayjs instance augmentation wherever this module is imported\nimport type {} from \"../types/dayjs-intl\"\n\nexport interface IDayjsIntlConfig {\n locale?: Intl.LocalesArgument\n options?: Intl.DateTimeFormatOptions\n}\n\nexport interface IDayjsIntlResolvedConfig {\n locale: Intl.LocalesArgument\n options: Intl.DateTimeFormatOptions\n}\n\nconst DEFAULT_INTL_CONFIG: IDayjsIntlResolvedConfig = {\n locale: \"pt-BR\",\n options: {\n month: \"long\",\n day: \"numeric\",\n year: \"numeric\",\n },\n}\n\nlet globalIntlConfig: IDayjsIntlResolvedConfig = {\n locale: DEFAULT_INTL_CONFIG.locale,\n options: { ...DEFAULT_INTL_CONFIG.options },\n}\n\nfunction mergeIntlConfigs(\n base: IDayjsIntlResolvedConfig,\n override?: IDayjsIntlConfig,\n): IDayjsIntlResolvedConfig {\n if (!override) {\n return {\n locale: base.locale,\n options: { ...base.options },\n }\n }\n\n const mergedLocale = override.locale ?? base.locale\n const mergedOptions: Intl.DateTimeFormatOptions = { ...base.options }\n\n if (override.options) {\n for (const key of Object.keys(override.options) as Array<\n keyof Intl.DateTimeFormatOptions\n >) {\n const value = override.options[key]\n\n if (value === undefined || value === null) {\n delete mergedOptions[key]\n } else {\n mergedOptions[key] = value as never\n }\n }\n }\n\n return {\n locale: mergedLocale,\n options: mergedOptions,\n }\n}\n\nconst intlPlugin: PluginFunc<IDayjsIntlConfig | undefined> = (\n pluginConfig,\n DayjsClass,\n) => {\n if (pluginConfig) {\n globalIntlConfig = mergeIntlConfigs(globalIntlConfig, pluginConfig)\n }\n\n const formatIntl = function formatIntl(\n this: DayjsInstance,\n config?: IDayjsIntlConfig,\n ): string {\n const resolved = mergeIntlConfigs(globalIntlConfig, config)\n return new Intl.DateTimeFormat(resolved.locale, resolved.options).format(\n this.toDate(),\n )\n }\n\n const toIntlFormatter = function toIntlFormatter(\n this: DayjsInstance,\n config?: IDayjsIntlConfig,\n ): Intl.DateTimeFormat {\n const resolved = mergeIntlConfigs(globalIntlConfig, config)\n return new Intl.DateTimeFormat(resolved.locale, resolved.options)\n }\n\n Object.defineProperty(DayjsClass.prototype, \"formatIntl\", {\n value: formatIntl,\n configurable: true,\n })\n\n Object.defineProperty(DayjsClass.prototype, \"toIntlFormatter\", {\n value: toIntlFormatter,\n configurable: true,\n })\n}\n\nexport function getDayjsGlobalIntl(): IDayjsIntlResolvedConfig {\n return {\n locale: globalIntlConfig.locale,\n options: { ...globalIntlConfig.options },\n }\n}\n\nexport function setDayjsGlobalIntl(\n config: IDayjsIntlConfig,\n): IDayjsIntlResolvedConfig {\n globalIntlConfig = mergeIntlConfigs(globalIntlConfig, config)\n return getDayjsGlobalIntl()\n}\n\nexport function resetDayjsGlobalIntl(): IDayjsIntlResolvedConfig {\n globalIntlConfig = {\n locale: DEFAULT_INTL_CONFIG.locale,\n options: { ...DEFAULT_INTL_CONFIG.options },\n }\n return getDayjsGlobalIntl()\n}\n\nexport function withDayjsGlobalIntl<T>(\n config: IDayjsIntlConfig,\n callback: () => T,\n): T {\n const previous = getDayjsGlobalIntl()\n globalIntlConfig = mergeIntlConfigs(globalIntlConfig, config)\n\n try {\n return callback()\n } finally {\n globalIntlConfig = {\n locale: previous.locale,\n options: { ...previous.options },\n }\n }\n}\n\nexport function resolveDayjsIntlConfig(\n config?: IDayjsIntlConfig,\n): IDayjsIntlResolvedConfig {\n return mergeIntlConfigs(globalIntlConfig, config)\n}\n\ndayJs.extend(utc)\ndayJs.extend(customParseFormat)\ndayJs.extend(advancedFormat)\ndayJs.extend(timezone)\ndayJs.extend(localizedFormat)\ndayJs.extend(relativeTime)\ndayJs.extend(intlPlugin)\n\nexport const dayjs = dayJs\n","import type { Dayjs } from \"dayjs\"\n\nimport { dayjs } from \"./dayjs\"\n\nexport function fixTimezoneOffset(utcDate: Date | string): Dayjs {\n const offset = new Date(utcDate).getTimezoneOffset()\n return dayjs(utcDate).add(offset, \"minute\")\n}\n","import type { IDayjsIntlConfig } from \"./dayjs\"\nimport { dayjs, getDayjsGlobalIntl } from \"./dayjs\"\n\nexport interface IFormatDateConfig {\n /** Optional locale override applied to the underlying dayjs instance */\n locale?: string\n /**\n * When provided, format using dayjs tokens (e.g. \"DD/MM/YYYY\").\n * Unless `useIntl` is true, this takes precedence over Intl formatting.\n */\n format?: string\n /**\n * Intl configuration used when formatting through `Intl.DateTimeFormat`.\n * Values are merged on top of the global Intl configuration.\n */\n intl?: IDayjsIntlConfig\n /**\n * Forces the use of Intl formatting even if a format string is supplied.\n */\n useIntl?: boolean\n}\n\ntype TLocaleOrConfig = Intl.LocalesArgument | IFormatDateConfig\n\nfunction isFormatDateConfig(\n value: TLocaleOrConfig,\n): value is IFormatDateConfig {\n return Boolean(value) && typeof value === \"object\" && !Array.isArray(value)\n}\n\nfunction isValidLocaleTag(value: string): boolean {\n if (\n typeof Intl !== \"undefined\" &&\n typeof Intl.getCanonicalLocales === \"function\"\n ) {\n try {\n Intl.getCanonicalLocales(value)\n return true\n } catch {\n return false\n }\n }\n\n return /^[a-z]{2,3}(?:-[A-Za-z0-9]{2,8})*$/.test(value)\n}\n\nfunction toDayjsLocale(\n locale?:\n | Intl.LocalesArgument\n | Intl.Locale\n | readonly (string | Intl.Locale)[],\n): string | undefined {\n if (!locale) return undefined\n const first = Array.isArray(locale)\n ? (locale[0] as string | Intl.Locale)\n : (locale as string | Intl.Locale)\n return typeof first === \"string\" ? first : String(first)\n}\n\nexport function formatDate(\n date: Date | string | number,\n localeOrConfig: TLocaleOrConfig = getDayjsGlobalIntl().locale,\n opts?: Intl.DateTimeFormatOptions,\n): string {\n const instance = dayjs(date)\n\n if (!instance.isValid()) {\n throw new RangeError(\"Invalid time value\")\n }\n\n if (isFormatDateConfig(localeOrConfig)) {\n const { format, locale, intl, useIntl } = localeOrConfig\n const baseLocale = locale ?? toDayjsLocale(intl?.locale)\n const workingInstance = baseLocale ? instance.locale(baseLocale) : instance\n\n if (format && !useIntl) {\n return workingInstance.format(format)\n }\n\n const intlConfig: IDayjsIntlConfig | undefined = intl\n ? {\n locale: intl.locale ?? baseLocale,\n options: intl.options,\n }\n : baseLocale\n ? {\n locale: baseLocale,\n }\n : undefined\n\n return workingInstance.formatIntl(intlConfig)\n }\n\n if (typeof localeOrConfig === \"string\" && opts === undefined) {\n if (!isValidLocaleTag(localeOrConfig)) {\n return instance.format(localeOrConfig)\n }\n }\n\n const localeForDayjs = toDayjsLocale(localeOrConfig)\n const workingInstance = localeForDayjs\n ? instance.locale(localeForDayjs)\n : instance\n\n const intlConfig: IDayjsIntlConfig | undefined =\n localeOrConfig !== undefined || opts !== undefined\n ? {\n locale: localeOrConfig,\n options: opts,\n }\n : undefined\n\n return workingInstance.formatIntl(intlConfig)\n}\n","import type { Dayjs } from \"dayjs\"\n\nimport { dayjs } from \"./dayjs\"\n\nexport function getCurrentDateInUTC(): Dayjs {\n return dayjs().utc()\n}\n","import type { Dayjs } from \"dayjs\"\n\nimport { dayjs } from \"./dayjs\"\n\nexport function getDateInUTC(date: Date): Dayjs {\n return dayjs(date).utc()\n}\n","import type { ConfigType } from \"dayjs\"\nimport { dayjs } from \"./dayjs\"\n\nexport function getRelativeTime(date: ConfigType, dateNow = dayjs()): string {\n return dayjs(date).from(dateNow)\n}\n","import { fixTimezoneOffset } from \"./fix-timezone-offset\"\n\ninterface IUnitTranslation {\n singular: string\n plural: string\n}\n\ninterface ILocaleTranslations {\n year: IUnitTranslation\n month: IUnitTranslation\n day: IUnitTranslation\n hour: IUnitTranslation\n minute: IUnitTranslation\n second: IUnitTranslation\n // function to format verbose list (e.g. \"1 ano, 2 meses e 3 dias\")\n formatList: (parts: string[]) => string\n // tokens used for compact formatting (e.g. \"1a2m3d\")\n compactTokens: {\n year: string\n month: string\n day: string\n hour: string\n minute: string\n second: string\n }\n}\n\n// Supported locales and their translations\nconst locales: Record<string, ILocaleTranslations> = {\n \"pt-BR\": {\n year: { singular: \"ano\", plural: \"anos\" },\n month: { singular: \"mês\", plural: \"meses\" },\n day: { singular: \"dia\", plural: \"dias\" },\n hour: { singular: \"hora\", plural: \"horas\" },\n minute: { singular: \"minuto\", plural: \"minutos\" },\n second: { singular: \"segundo\", plural: \"segundos\" },\n formatList: (parts) => {\n if (parts.length === 0) return \"\"\n if (parts.length === 1) return parts[0]\n const lastPart = parts[parts.length - 1]\n const otherParts = parts.slice(0, -1)\n return `${otherParts.join(\", \")} e ${lastPart}`\n },\n compactTokens: {\n year: \"a\",\n month: \"m\",\n day: \"d\",\n hour: \"h\",\n minute: \"min\",\n second: \"s\",\n },\n },\n \"en-US\": {\n year: { singular: \"year\", plural: \"years\" },\n month: { singular: \"month\", plural: \"months\" },\n day: { singular: \"day\", plural: \"days\" },\n hour: { singular: \"hour\", plural: \"hours\" },\n minute: { singular: \"minute\", plural: \"minutes\" },\n second: { singular: \"second\", plural: \"seconds\" },\n formatList: (parts) => {\n if (parts.length === 0) return \"\"\n if (parts.length === 1) return parts[0]\n if (parts.length === 2) return `${parts[0]} and ${parts[1]}`\n return `${parts.slice(0, -1).join(\", \")}, and ${parts[parts.length - 1]}`\n },\n compactTokens: {\n year: \"y\",\n month: \"mo\",\n day: \"d\",\n hour: \"h\",\n minute: \"m\",\n second: \"s\",\n },\n },\n \"es-ES\": {\n year: { singular: \"año\", plural: \"años\" },\n month: { singular: \"mes\", plural: \"meses\" },\n day: { singular: \"día\", plural: \"días\" },\n hour: { singular: \"hora\", plural: \"horas\" },\n minute: { singular: \"minuto\", plural: \"minutos\" },\n second: { singular: \"segundo\", plural: \"segundos\" },\n formatList: (parts) => {\n if (parts.length === 0) return \"\"\n if (parts.length === 1) return parts[0]\n const lastPart = parts[parts.length - 1]\n const otherParts = parts.slice(0, -1)\n return `${otherParts.join(\", \")} y ${lastPart}`\n },\n compactTokens: {\n year: \"a\",\n month: \"mes\",\n day: \"d\",\n hour: \"h\",\n minute: \"min\",\n second: \"s\",\n },\n },\n \"fr-FR\": {\n year: { singular: \"an\", plural: \"ans\" },\n month: { singular: \"mois\", plural: \"mois\" },\n day: { singular: \"jour\", plural: \"jours\" },\n hour: { singular: \"heure\", plural: \"heures\" },\n minute: { singular: \"minute\", plural: \"minutes\" },\n second: { singular: \"seconde\", plural: \"secondes\" },\n formatList: (parts) => {\n if (parts.length === 0) return \"\"\n if (parts.length === 1) return parts[0]\n const lastPart = parts[parts.length - 1]\n const otherParts = parts.slice(0, -1)\n return `${otherParts.join(\", \")} et ${lastPart}`\n },\n compactTokens: {\n year: \"a\",\n month: \"m\",\n day: \"j\",\n hour: \"h\",\n minute: \"min\",\n second: \"s\",\n },\n },\n}\n\n// Return shape\nexport interface ITimeSpent {\n years: number\n months: number\n days: number\n hours: number\n minutes: number\n seconds: number\n formatted: string\n}\n\n// options: format -> 'verbose' | 'compact', minimal -> show only largest non-zero unit\nexport function parseTimeSpent(\n initialDate: string | Date,\n finalDate: string | Date,\n locale = \"pt-BR\", // Default to Portuguese for backward compatibility\n options?: { format?: \"verbose\" | \"compact\"; minimal?: boolean },\n): ITimeSpent {\n const final = fixTimezoneOffset(finalDate)\n const initial = fixTimezoneOffset(initialDate)\n\n const years = final.diff(initial, \"year\")\n const months = final.diff(initial.add(years, \"year\"), \"month\")\n const days = final.diff(\n initial.add(years, \"year\").add(months, \"month\"),\n \"day\",\n )\n const hours = final.diff(\n initial.add(years, \"year\").add(months, \"month\").add(days, \"day\"),\n \"hour\",\n )\n const minutes = final.diff(\n initial\n .add(years, \"year\")\n .add(months, \"month\")\n .add(days, \"day\")\n .add(hours, \"hour\"),\n \"minute\",\n )\n const seconds = final.diff(\n initial\n .add(years, \"year\")\n .add(months, \"month\")\n .add(days, \"day\")\n .add(hours, \"hour\")\n .add(minutes, \"minute\"),\n \"second\",\n )\n\n // Use default locale if the requested one isn't supported\n const translations = locales[locale] || locales[\"pt-BR\"]\n\n // Build verbose parts (localized words)\n const verboseParts: string[] = []\n if (years > 0) {\n const unit =\n years === 1 ? translations.year.singular : translations.year.plural\n verboseParts.push(`${years} ${unit}`)\n }\n if (months > 0) {\n const unit =\n months === 1 ? translations.month.singular : translations.month.plural\n verboseParts.push(`${months} ${unit}`)\n }\n if (days > 0) {\n const unit =\n days === 1 ? translations.day.singular : translations.day.plural\n verboseParts.push(`${days} ${unit}`)\n }\n if (hours > 0) {\n const unit =\n hours === 1 ? translations.hour.singular : translations.hour.plural\n verboseParts.push(`${hours} ${unit}`)\n }\n if (minutes > 0) {\n const unit =\n minutes === 1 ? translations.minute.singular : translations.minute.plural\n verboseParts.push(`${minutes} ${unit}`)\n }\n if (seconds > 0) {\n const unit =\n seconds === 1 ? translations.second.singular : translations.second.plural\n verboseParts.push(`${seconds} ${unit}`)\n }\n\n // Build compact parts (e.g. \"1a2m3d\")\n const compactPieces: string[] = []\n if (years > 0)\n compactPieces.push(`${years}${translations.compactTokens.year}`)\n if (months > 0)\n compactPieces.push(`${months}${translations.compactTokens.month}`)\n if (days > 0) compactPieces.push(`${days}${translations.compactTokens.day}`)\n if (hours > 0)\n compactPieces.push(`${hours}${translations.compactTokens.hour}`)\n if (minutes > 0)\n compactPieces.push(`${minutes}${translations.compactTokens.minute}`)\n if (seconds > 0)\n compactPieces.push(`${seconds}${translations.compactTokens.second}`)\n\n const format = options?.format ?? \"verbose\"\n const minimal = options?.minimal ?? false\n\n let formatted = \"\"\n if (format === \"compact\") {\n if (compactPieces.length === 0) {\n formatted = \"\"\n } else if (minimal) {\n formatted = compactPieces[0]\n } else {\n formatted = compactPieces.join(\"\")\n }\n } else {\n // verbose\n if (verboseParts.length === 0) {\n formatted = \"\"\n } else if (minimal) {\n formatted = verboseParts[0]\n } else {\n formatted = translations.formatList(verboseParts)\n }\n }\n\n return {\n years,\n months,\n days,\n hours,\n minutes,\n seconds,\n formatted,\n }\n}\n"]}
|
package/dist/files/index.d.mts
DELETED
package/dist/nextjs/index.d.mts
DELETED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|