(theme: Partial<Theme>)
| 11 | } |
| 12 | |
| 13 | export function Theme(theme: Partial<Theme>): Theme { |
| 14 | const completed: Theme = { |
| 15 | palette: { |
| 16 | bg: theme.palette?.bg ?? ["#fff", "#e5e5e5"], |
| 17 | text: theme.palette?.text ?? ["#000", "#808080"], |
| 18 | color: theme.palette?.color ?? [], |
| 19 | }, |
| 20 | css: theme.css ?? "", |
| 21 | extends: theme.extends ?? undefined, |
| 22 | }; |
| 23 | |
| 24 | while (completed.palette.bg && completed.palette.bg.length < 4) { |
| 25 | completed.palette.bg.push(completed.palette.bg[completed.palette.bg.length - 1]); |
| 26 | } |
| 27 | while (completed.palette.text && completed.palette.text.length < 4) { |
| 28 | completed.palette.text.push(completed.palette.text[completed.palette.text.length - 1]); |
| 29 | } |
| 30 | |
| 31 | return completed; |
| 32 | } |
no outgoing calls
no test coverage detected