21 lines
535 B
TypeScript
21 lines
535 B
TypeScript
import { type ClassValue, clsx } from "clsx"
|
|
import { twMerge } from "tailwind-merge"
|
|
|
|
export function cn(...inputs: ClassValue[]) {
|
|
return twMerge(clsx(inputs))
|
|
}
|
|
|
|
export function processFileType(file: string) {
|
|
const ending = file.split(".").pop()
|
|
|
|
if (ending === "ts" || ending === "tsx") return "typescript"
|
|
if (ending === "js" || ending === "jsx") return "javascript"
|
|
|
|
if (ending) return ending
|
|
return "plaintext"
|
|
}
|
|
|
|
export function decodeTerminalResponse(buffer: Buffer): string {
|
|
return buffer.toString("utf-8")
|
|
}
|