www/lib/utils.ts

8 lines
307 B
TypeScript
Raw Normal View History

2024-07-01 11:11:56 -04:00
type ClassValue = string | number | boolean | undefined | null;
type ClassArray = ClassValue[];
type ClassDictionary = Record<string, any>;
type ClassProp = ClassValue | ClassArray | ClassDictionary;
export function cn(...inputs: ClassProp[]): string {
return inputs.flat().filter(Boolean).join(' ');
}