14 lines
404 B
TypeScript
14 lines
404 B
TypeScript
export function c(input: Array<string | boolean> | object): string {
|
|
const array = Array.isArray(input)
|
|
? input.filter(el => typeof el === 'string')
|
|
: Object.keys(input).filter(key => !!input[key]);
|
|
return array.join(' ');
|
|
}
|
|
|
|
export function s(styles: object): string {
|
|
return Object.keys(styles)
|
|
.filter(key => !!styles[key])
|
|
.map(key => `${key}:${styles[key]}`)
|
|
.join(';');
|
|
}
|