Throw some initial version of code at the wall for the tabbed character sheet

This commit is contained in:
Oliver-Akins 2025-02-11 23:40:35 -07:00
parent eb6d7fee94
commit b72f22380f
10 changed files with 213 additions and 2 deletions

View file

@ -0,0 +1,14 @@
/**
* Allows converting an object of <class names, boolean-likes> into an HTML-compatible class list.
*
* @param {Record<string, any>} obj The object of class names to boolean-like values for if that class should be included.
*/
export function toClasses(obj = {}) {
let classes = [];
for (const [ klass, include ] of Object.entries(obj)) {
if (include) {
classes.push(klass);
};
};
return new Handlebars.SafeString(classes.join(` `));
};