mirror of
https://github.com/ArthurDanjou/ui.git
synced 2026-01-16 13:08:06 +01:00
17 lines
444 B
TypeScript
17 lines
444 B
TypeScript
export function classNames (...classes: any[string]) {
|
|
return classes.filter(Boolean).join(' ')
|
|
}
|
|
|
|
export const kebabCase = (str: string) => {
|
|
return str
|
|
?.match(/[A-Z]{2,}(?=[A-Z][a-z]+[0-9]*|\b)|[A-Z]?[a-z]+[0-9]*|[A-Z]|[0-9]+/g)
|
|
?.map(x => x.toLowerCase())
|
|
?.join('-')
|
|
}
|
|
|
|
export const omit = (obj: object, keys: string[]) => {
|
|
return Object.fromEntries(
|
|
Object.entries(obj).filter(([key]) => !keys.includes(key))
|
|
)
|
|
}
|