* Get the value for a attribute on a node. Only used in DEV for SSR validation. * The third argument is used as a hint of what the expected value is. Some * attributes have multiple equivalent values.
(node, name, expected)
| 4349 | * attributes have multiple equivalent values. |
| 4350 | */ |
| 4351 | function getValueForAttribute(node, name, expected) { |
| 4352 | { |
| 4353 | if (!isAttributeNameSafe(name)) { |
| 4354 | return; |
| 4355 | } |
| 4356 | if (!node.hasAttribute(name)) { |
| 4357 | return expected === undefined ? undefined : null; |
| 4358 | } |
| 4359 | var value = node.getAttribute(name); |
| 4360 | if (value === '' + expected) { |
| 4361 | return expected; |
| 4362 | } |
| 4363 | return value; |
| 4364 | } |
| 4365 | } |
| 4366 | |
| 4367 | /** |
| 4368 | * Sets the value for a property on a node. |
no test coverage detected