Spaces:
Paused
Paused
Download client/src/lib/utils.ts from guardiancc/FacePoke: direct link, hf CLI and curl.
- Browser
- Download file 436 Bytes
-
https://huggingface.co/spaces/guardiancc/FacePoke/resolve/main/client/src/lib/utils.ts
- Command line
-
hf download hf://spaces/guardiancc/FacePoke/client/src/lib/utils.ts
-
curl -L -o utils.ts https://huggingface.co/spaces/guardiancc/FacePoke/resolve/main/client/src/lib/utils.ts
436 Bytes
| import { clsx, type ClassValue } from "clsx" | |
| import { twMerge } from "tailwind-merge" | |
| export function cn(...inputs: ClassValue[]) { | |
| return twMerge(clsx(inputs)) | |
| } | |
| export function truncateFileName(fileName: string, maxLength: number = 16) { | |
| if (fileName.length <= maxLength) return fileName; | |
| const start = fileName.slice(0, maxLength / 2 - 1); | |
| const end = fileName.slice(-maxLength / 2 + 2); | |
| return `${start}...${end}`; | |
| }; | |