Download webapp/lib/utils.ts from gaaaaaaaaaaa/trajectory_rag: direct link, hf CLI and curl.
- Browser
- Download file 404 Bytes
-
https://huggingface.co/gaaaaaaaaaaa/trajectory_rag/resolve/main/webapp/lib/utils.ts
- Command line
-
hf download hf://gaaaaaaaaaaa/trajectory_rag/webapp/lib/utils.ts
-
curl -L -o utils.ts https://huggingface.co/gaaaaaaaaaaa/trajectory_rag/resolve/main/webapp/lib/utils.ts
404 Bytes
| import { clsx, type ClassValue } from "clsx"; | |
| import { twMerge } from "tailwind-merge"; | |
| export function cn(...inputs: ClassValue[]) { | |
| return twMerge(clsx(inputs)); | |
| } | |
| export function truncateMiddle(value: string, maxLength = 48) { | |
| if (value.length <= maxLength) return value; | |
| const edge = Math.max(6, Math.floor((maxLength - 3) / 2)); | |
| return `${value.slice(0, edge)}...${value.slice(-edge)}`; | |
| } | |