type Colors = { [key: string]: | string | { [key: string]: string } } export default (colors: Colors) => { const formattedColors: string[] = [] for (const [key, value] of Object.entries(colors)) { if (typeof value === 'string') { formattedColors.push(key) } else { for (const [colorGroup, colorSubGroup] of Object.entries(value)) { formattedColors.push(`${key}-${colorGroup}`) } } } return formattedColors }