(...classes: (string | false | undefined | null | { [className: string]: any })[])
| 20 | * Utility to join classes conditionally |
| 21 | */ |
| 22 | export function classes(...classes: (string | false | undefined | null | { [className: string]: any })[]): string { |
| 23 | return classes |
| 24 | .map(c => c && typeof c === 'object' ? Object.keys(c).map(key => !!c[key] && key) : [c]) |
| 25 | .reduce((flattened, c) => flattened.concat(c), [] as string[]) |
| 26 | .filter(c => !!c) |
| 27 | .join(' '); |
| 28 | } |
| 29 | |
| 30 | /** |
| 31 | * Merges various styles into a single style object. |
no outgoing calls
no test coverage detected
searching dependent graphs…