* Mapping between attributes names that don't correspond to their element property names. * * Performance note: this function is written as a series of if checks (instead of, say, a property * object lookup) for performance reasons - the series of `if` checks seems to be the fastest way of * map
(name: string)
| 238 | * Note: this mapping has to be kept in sync with the equivalent mappings in the compiler. |
| 239 | */ |
| 240 | function mapPropName(name: string): string { |
| 241 | if (name === 'class') return 'className'; |
| 242 | if (name === 'for') return 'htmlFor'; |
| 243 | if (name === 'formaction') return 'formAction'; |
| 244 | if (name === 'innerHtml') return 'innerHTML'; |
| 245 | if (name === 'readonly') return 'readOnly'; |
| 246 | if (name === 'tabindex') return 'tabIndex'; |
| 247 | return name; |
| 248 | } |
| 249 | |
| 250 | export function setPropertyAndInputs<T>( |
| 251 | tNode: TNode, |
no outgoing calls
no test coverage detected
searching dependent graphs…