framework/js/lib/utils/class-list.js
2015-04-25 22:28:39 +09:30

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(' ');
}