Download lib/utils.ts from d3evil4/scrape: direct link, hf CLI and curl.
- Browser
- Download file 549 Bytes
-
https://huggingface.co/spaces/d3evil4/scrape/resolve/main/lib/utils.ts
- Command line
-
hf download hf://spaces/d3evil4/scrape/lib/utils.ts
-
curl -L -o utils.ts https://huggingface.co/spaces/d3evil4/scrape/resolve/main/lib/utils.ts
549 Bytes
| import { clsx, type ClassValue } from "clsx"; | |
| import { twMerge } from "tailwind-merge"; | |
| export function cn(...inputs: ClassValue[]) { | |
| return twMerge(clsx(inputs)); | |
| } | |
| export function formatDuration(seconds: number): string { | |
| const mins = Math.floor(seconds / 60); | |
| const secs = Math.floor(seconds % 60); | |
| return `${mins}:${secs.toString().padStart(2, "0")}`; | |
| } | |
| export function formatFileSize(bytes: number): string { | |
| if (bytes < 1024 * 1024) return `${(bytes / 1024).toFixed(1)} KB`; | |
| return `${(bytes / (1024 * 1024)).toFixed(1)} MB`; | |
| } | |