import { objectKeys } from './objectKeys' ; import { addLogo } from './merge' ; export function setClasses ( el , val ) { el . setAttribute ( 'class' , val . split ( ' ' ) . map ( ( name ) => addLogo ( name ) ) . join ( ' ' ) ) ; } export function classNames ( names , config = { } ) { return ( ) => { return objectKeys ( config ) . reduce ( ( classNames , key ) => { return config [ key ] ( ) ? `${ classNames } ${ key }` : classNames ; } , names ) ; } ; } export function styleNames ( styles = { } ) { return ( ) => objectKeys ( styles ) . reduce ( ( stylesName , sty ) => { return stylesName . concat ( `${ sty }:${ styles [ sty ] }` ) ; } , '' ) ; }