Артем Леванов
first commit
41a71fd
raw
history blame contribute delete
384 Bytes
type Mods = Record<string, boolean | string | undefined>;
export function classNames(cls: string, mods: Mods = {}, additional: Array<string | undefined> = []): string {
return [
cls,
...additional.filter(Boolean),
...Object.entries(mods)
.filter(([_, value]) => Boolean(value))
.map(([className]) => className),
].join(' ');
}