File size: 360 Bytes
0842d68
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
const cn = (...classes: Array<Record<string, boolean> | string>): string =>
  classes
    .map((entry) =>
      typeof entry === "string"
        ? entry
        : Object.entries(entry || {})
            .filter(([, append]) => append)
            .map(([cl]) => cl)
            .join(" ")
    )
    .filter((e) => e !== "")
    .join(" ");
export default cn;