UNPKG

classjoin

Version:

A bit simpler utility for conditionally joining classNames together

16 lines 469 B
function classJoin(withConditions, withoutConditions) { var classes = []; var keys = Object.keys(withConditions); for (var i = 0, n = keys.length; i < n; i++) { var key = keys[i]; if (withConditions[key]) { classes.push(key); } } if (withoutConditions) { classes = withoutConditions.concat(classes); } return classes.join(' '); } export { classJoin as default, }; //# sourceMappingURL=index.js.map