mirror of
https://github.com/nicotsx/zerobyte.git
synced 2026-06-02 13:13:43 -04:00
16 lines
340 B
TypeScript
16 lines
340 B
TypeScript
import { type ClassValue, clsx } from "clsx";
|
|
import { twMerge } from "tailwind-merge";
|
|
|
|
/** Conditional merge of class names */
|
|
export function cn(...inputs: ClassValue[]) {
|
|
return twMerge(clsx(inputs));
|
|
}
|
|
|
|
export function safeJsonParse<T>(input: string): T | null {
|
|
try {
|
|
return JSON.parse(input) as T;
|
|
} catch {
|
|
return null;
|
|
}
|
|
}
|