22 lines
485 B
TypeScript
22 lines
485 B
TypeScript
import { clsx, type ClassValue } from 'clsx'
|
||
import { twMerge } from 'tailwind-merge'
|
||
|
||
export function cn(...inputs: ClassValue[]) {
|
||
return twMerge(clsx(inputs))
|
||
}
|
||
|
||
export function slugify(text: string) {
|
||
return text
|
||
.toLowerCase()
|
||
.replace(/ğ/g, 'g')
|
||
.replace(/ü/g, 'u')
|
||
.replace(/ş/g, 's')
|
||
.replace(/ı/g, 'i')
|
||
.replace(/ö/g, 'o')
|
||
.replace(/ç/g, 'c')
|
||
.replace(/\s+/g, '-')
|
||
.replace(/[^\w-]+/g, '')
|
||
.replace(/--+/g, '-')
|
||
.trim()
|
||
}
|