2019-06-18 00:36:19 +02:00
|
|
|
export function c(input: Array<string | boolean> | object): string {
|
|
|
|
const array = Array.isArray(input)
|
|
|
|
? input.filter(el => typeof el === 'string')
|
2019-06-23 23:11:26 +02:00
|
|
|
: Object.keys(input).filter((key: keyof object) => !!input[key]);
|
2019-06-18 00:36:19 +02:00
|
|
|
return array.join(' ');
|
|
|
|
}
|
|
|
|
|
|
|
|
export function s(styles: object): string {
|
|
|
|
return Object.keys(styles)
|
2019-06-23 23:11:26 +02:00
|
|
|
.filter((key: keyof object) => !!styles[key])
|
|
|
|
.map((key: keyof object) => `${key}:${styles[key]}`)
|
2019-06-18 00:36:19 +02:00
|
|
|
.join(';');
|
|
|
|
}
|