2019-06-18 00:36:19 +02:00
|
|
|
export function c(input: Array<string | boolean> | object): string {
|
|
|
|
const array = Array.isArray(input)
|
2019-06-30 02:00:26 +02:00
|
|
|
? input.filter((el: any) => 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-10-12 03:48:36 +02:00
|
|
|
.filter(
|
|
|
|
(key: keyof object) => typeof styles[key] === 'number' || (typeof styles[key] === 'string' && !!styles[key])
|
|
|
|
)
|
2019-06-23 23:11:26 +02:00
|
|
|
.map((key: keyof object) => `${key}:${styles[key]}`)
|
2019-06-18 00:36:19 +02:00
|
|
|
.join(';');
|
|
|
|
}
|
2019-07-26 23:05:29 +02:00
|
|
|
|
|
|
|
export function t(text: string): string {
|
|
|
|
// If you want to implement frontend translation, begin here.
|
|
|
|
return text;
|
|
|
|
}
|