(value: unknown)
| 61 | } |
| 62 | |
| 63 | export function normalizeClass(value: unknown): string { |
| 64 | let res = class="st">'' |
| 65 | if (isString(value)) { |
| 66 | res = value |
| 67 | } else if (isArray(value)) { |
| 68 | for (let i = 0; i < value.length; i++) { |
| 69 | const normalized = normalizeClass(value[i]) |
| 70 | if (normalized) { |
| 71 | res += normalized + class="st">' ' |
| 72 | } |
| 73 | } |
| 74 | } else if (isObject(value)) { |
| 75 | for (const name in value) { |
| 76 | if (value[name]) { |
| 77 | res += name + class="st">' ' |
| 78 | } |
| 79 | } |
| 80 | } |
| 81 | return res.trim() |
| 82 | } |
| 83 | |
| 84 | export function normalizeProps( |
| 85 | props: Record<string, any> | null, |
no test coverage detected