mirror of
https://github.com/flarum/framework.git
synced 2024-11-25 09:41:49 +08:00
13 lines
272 B
JavaScript
13 lines
272 B
JavaScript
export default function classList(classes) {
|
|
var classNames = [];
|
|
for (var i in classes) {
|
|
var value = classes[i];
|
|
if (value === true) {
|
|
classNames.push(i);
|
|
} else if (value) {
|
|
classNames.push(value);
|
|
}
|
|
}
|
|
return classNames.join(' ');
|
|
}
|