import { kebab } from 'case' ; import mapObject from 'map-obj' ; import type { PollenModule } from '../types' ; export function formatModule ( module ) { return Object . keys ( module ) . map ( ( family ) => { return mapObject ( module [ family as keyof typeof module ] , ( key , value ) => [ `--${ kebab ( family ) }-${ kebab ( String ( key ) ) }` , value ] ) ; } ) . reduce ( ( acc , cur ) => ( { ... acc , ... cur } ) , { } ) ; }