Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- const bem = (className, config = {}) => {
- return Object.entries(config).reduce((result, [key, value]) => {
- if (value) {
- return result.concat(`${className}--${key}${typeof value !== "boolean" ? `-${value}` : ""}`);
- }
- return result;
- }, [className]).join(" ");
- };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement