[+] UI helper for class

pull/10/head
Azalea 2024-02-12 02:59:33 -05:00
parent 8932a16468
commit e14ff26915
1 changed files with 9 additions and 0 deletions

View File

@ -90,3 +90,12 @@ export const CHARTJS_OPT: ChartOptions<"line"> = {
}
},
}
/**
* Usage: clazz({a: false, b: true}) -> "b"
*
* @param obj HashMap<string, boolean>
*/
export function clazz(obj: { [key: string]: boolean }) {
return Object.keys(obj).filter(k => obj[k]).join(" ")
}