(styleAttr: string)
| 183 | } |
| 184 | |
| 185 | function parseStyleAttr(styleAttr: string): Record<string, string> { |
| 186 | const result: Record<string, string> = {}; |
| 187 | for (const decl of splitStyleDeclarations(styleAttr)) { |
| 188 | const idx = decl.indexOf(":"); |
| 189 | if (idx === -1) continue; |
| 190 | const rawProp = decl.slice(0, idx).trim(); |
| 191 | const value = decl.slice(idx + 1).trim(); |
| 192 | if (!rawProp) continue; |
| 193 | result[toCamel(rawProp)] = value; |
| 194 | } |
| 195 | return result; |
| 196 | } |
| 197 | |
| 198 | /** Serialize camelCase style map → style attribute string. */ |
| 199 | function serializeStyleAttr(styles: Record<string, string>): string { |
no test coverage detected