const CssHandlers = { object : ( obj , result ) => { for ( const key in obj ) { if ( obj [ key ] ) { result . push ( key ) ; } } } , string : ( str , result ) => result . push ( str ) } ; export function css ( ... args ) { const result = [ ] ; for ( const arg of args ) { const handler = CssHandlers [ typeof arg ] ; if ( arg && handler ) { handler ( arg , result ) ; } } return result . join ( ' ' ) ; } function reduceObject < T > ( object , callback ) { if ( ! object ) { return object ; } return Object . keys ( object ) . reduce ( ( result , key ) => { if ( callback ( key ) ) { result [ key ] = object [ key ] ; } return result ; } , { } as T ) ; } export function getDataAndAriaProps < T > ( props ) { return reduceObject ( props || { } , propName => propName . indexOf ( 'data-' ) === 0 || propName . indexOf ( 'aria-' ) === 0 ) ; }