@herowcode/utils 1.5.1 → 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-6IYD4APX.js +28 -0
- package/dist/chunk-6IYD4APX.js.map +1 -0
- package/dist/chunk-7X4LRL26.js +103 -0
- package/dist/chunk-7X4LRL26.js.map +1 -0
- package/dist/chunk-D3RLXVKJ.cjs +30 -0
- package/dist/chunk-D3RLXVKJ.cjs.map +1 -0
- package/dist/{chunk-AQZBHMTO.js → chunk-DVHDU327.js} +16 -26
- package/dist/chunk-DVHDU327.js.map +1 -0
- package/dist/chunk-KWMJV4VK.cjs +110 -0
- package/dist/chunk-KWMJV4VK.cjs.map +1 -0
- package/dist/{chunk-UXEUYHBD.cjs → chunk-LN36GFUC.cjs} +12 -12
- package/dist/chunk-LN36GFUC.cjs.map +1 -0
- package/dist/{chunk-SLYUARZG.cjs → chunk-SLDBIYI4.cjs} +16 -26
- package/dist/chunk-SLDBIYI4.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 +16 -7
- 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 -11
- package/dist/files/index.browser.js +13 -2
- package/dist/files/index.browser.js.map +1 -1
- package/dist/files/index.cjs +8 -8
- package/dist/files/index.d.cts +3 -0
- package/dist/files/index.d.ts +3 -3
- package/dist/files/index.js +2 -2
- package/dist/files/index.node.cjs +11 -3
- 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 +4 -5
- package/dist/files/index.node.js +8 -1
- package/dist/files/index.node.js.map +1 -1
- package/dist/{files/index.browser.d.mts → format-bytes-B0QeE7As.d.cts} +2 -4
- package/dist/format-bytes-B0QeE7As.d.ts +12 -0
- package/dist/function/{index.d.mts → index.d.cts} +1 -1
- package/dist/index.cjs +21 -21
- package/dist/index.d.cts +12 -0
- package/dist/index.d.ts +4 -4
- package/dist/index.js +3 -3
- package/dist/nextjs/index.browser.cjs +5 -103
- package/dist/nextjs/index.browser.cjs.map +1 -1
- package/dist/nextjs/index.browser.js +1 -101
- package/dist/nextjs/index.browser.js.map +1 -1
- package/dist/nextjs/index.cjs +12 -0
- package/dist/nextjs/index.cjs.map +1 -0
- package/dist/nextjs/index.d.cts +3 -0
- package/dist/nextjs/index.d.ts +3 -0
- package/dist/nextjs/index.js +3 -0
- package/dist/nextjs/index.js.map +1 -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 +41 -31
- package/dist/chunk-AQZBHMTO.js.map +0 -1
- package/dist/chunk-GRSF4RY2.cjs +0 -20
- package/dist/chunk-GRSF4RY2.cjs.map +0 -1
- package/dist/chunk-O7SH3E3T.js +0 -18
- package/dist/chunk-O7SH3E3T.js.map +0 -1
- package/dist/chunk-QRXVUXGJ.js.map +0 -1
- package/dist/chunk-SLYUARZG.cjs.map +0 -1
- package/dist/chunk-UXEUYHBD.cjs.map +0 -1
- package/dist/files/index.d.mts +0 -3
- package/dist/format-bytes-BGjeDnvM.d.mts +0 -3
- package/dist/format-bytes-BGjeDnvM.d.ts +0 -3
- package/dist/index.d.mts +0 -12
- 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/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
|
@@ -1,110 +1,12 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
var Image = require('next/image');
|
|
5
|
-
var react = require('react');
|
|
6
|
-
var tailwindMerge = require('tailwind-merge');
|
|
7
|
-
var jsxRuntime = require('react/jsx-runtime');
|
|
3
|
+
var chunkKWMJV4VK_cjs = require('../chunk-KWMJV4VK.cjs');
|
|
8
4
|
|
|
9
|
-
function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
|
|
10
5
|
|
|
11
|
-
var clsx__default = /*#__PURE__*/_interopDefault(clsx);
|
|
12
|
-
var Image__default = /*#__PURE__*/_interopDefault(Image);
|
|
13
6
|
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
return
|
|
17
|
-
}
|
|
18
|
-
var OptimizedImage = react.forwardRef(
|
|
19
|
-
function OptimizedImage2({
|
|
20
|
-
src,
|
|
21
|
-
alt,
|
|
22
|
-
width,
|
|
23
|
-
height,
|
|
24
|
-
className,
|
|
25
|
-
fallbackText = "Falha ao carregar a imagem",
|
|
26
|
-
lazyLoad = true,
|
|
27
|
-
onLoad,
|
|
28
|
-
sizes,
|
|
29
|
-
...props
|
|
30
|
-
}, ref) {
|
|
31
|
-
const containerRef = react.useRef(null);
|
|
32
|
-
const [isLoading, setIsLoading] = react.useState(true);
|
|
33
|
-
const [hasError, setHasError] = react.useState(false);
|
|
34
|
-
const [isInView, setIsInView] = react.useState(!lazyLoad);
|
|
35
|
-
react.useEffect(() => {
|
|
36
|
-
if (!lazyLoad || !containerRef.current) {
|
|
37
|
-
setIsInView(true);
|
|
38
|
-
return;
|
|
39
|
-
}
|
|
40
|
-
const observer = new IntersectionObserver(
|
|
41
|
-
([entry]) => {
|
|
42
|
-
if (entry.isIntersecting) {
|
|
43
|
-
setIsInView(true);
|
|
44
|
-
observer.disconnect();
|
|
45
|
-
}
|
|
46
|
-
},
|
|
47
|
-
{ rootMargin: "200px" }
|
|
48
|
-
);
|
|
49
|
-
observer.observe(containerRef.current);
|
|
50
|
-
return () => {
|
|
51
|
-
observer.disconnect();
|
|
52
|
-
};
|
|
53
|
-
}, [lazyLoad]);
|
|
54
|
-
const handleLoad = (ev) => {
|
|
55
|
-
setIsLoading(false);
|
|
56
|
-
onLoad == null ? void 0 : onLoad(ev);
|
|
57
|
-
};
|
|
58
|
-
const handleError = () => {
|
|
59
|
-
setIsLoading(false);
|
|
60
|
-
setHasError(true);
|
|
61
|
-
};
|
|
62
|
-
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
63
|
-
"div",
|
|
64
|
-
{
|
|
65
|
-
ref: containerRef,
|
|
66
|
-
className: "relative overflow-hidden",
|
|
67
|
-
style: {
|
|
68
|
-
width: width != null ? `${Number(width)}px` : "100%",
|
|
69
|
-
height: height != null ? `${Number(height)}px` : "100%"
|
|
70
|
-
},
|
|
71
|
-
children: [
|
|
72
|
-
isLoading && /* @__PURE__ */ jsxRuntime.jsx(
|
|
73
|
-
"div",
|
|
74
|
-
{
|
|
75
|
-
className: "bg-muted absolute inset-0 animate-pulse rounded-md",
|
|
76
|
-
style: { width: "100%", height: "100%" }
|
|
77
|
-
}
|
|
78
|
-
),
|
|
79
|
-
hasError ? /* @__PURE__ */ jsxRuntime.jsx("div", { className: "bg-muted text-muted-foreground absolute inset-0 flex items-center justify-center rounded-md text-center text-sm", children: fallbackText }) : isInView && /* @__PURE__ */ jsxRuntime.jsx(
|
|
80
|
-
Image__default.default,
|
|
81
|
-
{
|
|
82
|
-
ref,
|
|
83
|
-
src: src || "/placeholder.svg",
|
|
84
|
-
alt,
|
|
85
|
-
width: width ? Number(width) : void 0,
|
|
86
|
-
height: height ? Number(height) : void 0,
|
|
87
|
-
sizes: sizes || "(max-width: 768px) 100vw, (max-width: 1200px) 50vw, 33vw",
|
|
88
|
-
quality: 80,
|
|
89
|
-
loading: props.priority ? "eager" : "lazy",
|
|
90
|
-
className: cn(
|
|
91
|
-
"rounded-md object-cover transition-opacity duration-300",
|
|
92
|
-
isLoading ? "opacity-0" : "opacity-100",
|
|
93
|
-
className
|
|
94
|
-
),
|
|
95
|
-
onLoad: handleLoad,
|
|
96
|
-
onError: handleError,
|
|
97
|
-
placeholder: "blur",
|
|
98
|
-
blurDataURL: "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mNk+P+/HgAEtAI8V7yQCgAAAABJRU5ErkJggg==",
|
|
99
|
-
...props
|
|
100
|
-
}
|
|
101
|
-
)
|
|
102
|
-
]
|
|
103
|
-
}
|
|
104
|
-
);
|
|
105
|
-
}
|
|
106
|
-
);
|
|
107
|
-
|
|
108
|
-
exports.OptimizedImage = OptimizedImage;
|
|
7
|
+
Object.defineProperty(exports, "OptimizedImage", {
|
|
8
|
+
enumerable: true,
|
|
9
|
+
get: function () { return chunkKWMJV4VK_cjs.OptimizedImage; }
|
|
10
|
+
});
|
|
109
11
|
//# sourceMappingURL=index.browser.cjs.map
|
|
110
12
|
//# sourceMappingURL=index.browser.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":[
|
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":"","file":"index.browser.cjs"}
|
|
@@ -1,103 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
import Image from 'next/image';
|
|
3
|
-
import { forwardRef, useRef, useState, useEffect } from 'react';
|
|
4
|
-
import { twMerge } from 'tailwind-merge';
|
|
5
|
-
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
6
|
-
|
|
7
|
-
// src/nextjs/optimized-image.tsx
|
|
8
|
-
function cn(...inputs) {
|
|
9
|
-
return twMerge(clsx(inputs));
|
|
10
|
-
}
|
|
11
|
-
var OptimizedImage = forwardRef(
|
|
12
|
-
function OptimizedImage2({
|
|
13
|
-
src,
|
|
14
|
-
alt,
|
|
15
|
-
width,
|
|
16
|
-
height,
|
|
17
|
-
className,
|
|
18
|
-
fallbackText = "Falha ao carregar a imagem",
|
|
19
|
-
lazyLoad = true,
|
|
20
|
-
onLoad,
|
|
21
|
-
sizes,
|
|
22
|
-
...props
|
|
23
|
-
}, ref) {
|
|
24
|
-
const containerRef = useRef(null);
|
|
25
|
-
const [isLoading, setIsLoading] = useState(true);
|
|
26
|
-
const [hasError, setHasError] = useState(false);
|
|
27
|
-
const [isInView, setIsInView] = useState(!lazyLoad);
|
|
28
|
-
useEffect(() => {
|
|
29
|
-
if (!lazyLoad || !containerRef.current) {
|
|
30
|
-
setIsInView(true);
|
|
31
|
-
return;
|
|
32
|
-
}
|
|
33
|
-
const observer = new IntersectionObserver(
|
|
34
|
-
([entry]) => {
|
|
35
|
-
if (entry.isIntersecting) {
|
|
36
|
-
setIsInView(true);
|
|
37
|
-
observer.disconnect();
|
|
38
|
-
}
|
|
39
|
-
},
|
|
40
|
-
{ rootMargin: "200px" }
|
|
41
|
-
);
|
|
42
|
-
observer.observe(containerRef.current);
|
|
43
|
-
return () => {
|
|
44
|
-
observer.disconnect();
|
|
45
|
-
};
|
|
46
|
-
}, [lazyLoad]);
|
|
47
|
-
const handleLoad = (ev) => {
|
|
48
|
-
setIsLoading(false);
|
|
49
|
-
onLoad == null ? void 0 : onLoad(ev);
|
|
50
|
-
};
|
|
51
|
-
const handleError = () => {
|
|
52
|
-
setIsLoading(false);
|
|
53
|
-
setHasError(true);
|
|
54
|
-
};
|
|
55
|
-
return /* @__PURE__ */ jsxs(
|
|
56
|
-
"div",
|
|
57
|
-
{
|
|
58
|
-
ref: containerRef,
|
|
59
|
-
className: "relative overflow-hidden",
|
|
60
|
-
style: {
|
|
61
|
-
width: width != null ? `${Number(width)}px` : "100%",
|
|
62
|
-
height: height != null ? `${Number(height)}px` : "100%"
|
|
63
|
-
},
|
|
64
|
-
children: [
|
|
65
|
-
isLoading && /* @__PURE__ */ jsx(
|
|
66
|
-
"div",
|
|
67
|
-
{
|
|
68
|
-
className: "bg-muted absolute inset-0 animate-pulse rounded-md",
|
|
69
|
-
style: { width: "100%", height: "100%" }
|
|
70
|
-
}
|
|
71
|
-
),
|
|
72
|
-
hasError ? /* @__PURE__ */ jsx("div", { className: "bg-muted text-muted-foreground absolute inset-0 flex items-center justify-center rounded-md text-center text-sm", children: fallbackText }) : isInView && /* @__PURE__ */ jsx(
|
|
73
|
-
Image,
|
|
74
|
-
{
|
|
75
|
-
ref,
|
|
76
|
-
src: src || "/placeholder.svg",
|
|
77
|
-
alt,
|
|
78
|
-
width: width ? Number(width) : void 0,
|
|
79
|
-
height: height ? Number(height) : void 0,
|
|
80
|
-
sizes: sizes || "(max-width: 768px) 100vw, (max-width: 1200px) 50vw, 33vw",
|
|
81
|
-
quality: 80,
|
|
82
|
-
loading: props.priority ? "eager" : "lazy",
|
|
83
|
-
className: cn(
|
|
84
|
-
"rounded-md object-cover transition-opacity duration-300",
|
|
85
|
-
isLoading ? "opacity-0" : "opacity-100",
|
|
86
|
-
className
|
|
87
|
-
),
|
|
88
|
-
onLoad: handleLoad,
|
|
89
|
-
onError: handleError,
|
|
90
|
-
placeholder: "blur",
|
|
91
|
-
blurDataURL: "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mNk+P+/HgAEtAI8V7yQCgAAAABJRU5ErkJggg==",
|
|
92
|
-
...props
|
|
93
|
-
}
|
|
94
|
-
)
|
|
95
|
-
]
|
|
96
|
-
}
|
|
97
|
-
);
|
|
98
|
-
}
|
|
99
|
-
);
|
|
100
|
-
|
|
101
|
-
export { OptimizedImage };
|
|
1
|
+
export { OptimizedImage } from '../chunk-7X4LRL26.js';
|
|
102
2
|
//# sourceMappingURL=index.browser.js.map
|
|
103
3
|
//# sourceMappingURL=index.browser.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":[
|
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":"","file":"index.browser.js"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var chunkKWMJV4VK_cjs = require('../chunk-KWMJV4VK.cjs');
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
Object.defineProperty(exports, "OptimizedImage", {
|
|
8
|
+
enumerable: true,
|
|
9
|
+
get: function () { return chunkKWMJV4VK_cjs.OptimizedImage; }
|
|
10
|
+
});
|
|
11
|
+
//# sourceMappingURL=index.cjs.map
|
|
12
|
+
//# sourceMappingURL=index.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":"","file":"index.cjs"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":"","file":"index.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"]}
|