You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
orario/src/utils.jsx

8 lines
248 B
React

2 years ago
export const withClasses = classes =>
Array.isArray(classes)
? classes.filter(e => !!e).join(' ')
: Object.entries(classes)
.filter(([, value]) => value)
.map(([key]) => key)
.join(' ')