mirror of
https://github.com/flarum/framework.git
synced 2024-12-01 14:20:47 +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(' ');
|
|
}
|