Function
setElementText
(el: TestElement, text: string)
Source from the content-addressed store, hash-verified
| 193 | } |
| 194 | |
| 195 | function setElementText(el: TestElement, text: string): void { |
| 196 | logNodeOp({ |
| 197 | type: NodeOpTypes.SET_ELEMENT_TEXT, |
| 198 | targetNode: el, |
| 199 | text, |
| 200 | }) |
| 201 | el.children.forEach(c => { |
| 202 | c.parentNode = null |
| 203 | }) |
| 204 | if (!text) { |
| 205 | el.children = [] |
| 206 | } else { |
| 207 | el.children = [ |
| 208 | { |
| 209 | id: nodeId++, |
| 210 | type: TestNodeTypes.TEXT, |
| 211 | text, |
| 212 | parentNode: el, |
| 213 | }, |
| 214 | ] |
| 215 | } |
| 216 | } |
| 217 | |
| 218 | function parentNode(node: TestNode): TestElement | null { |
| 219 | return node.parentNode |
Callers
nothing calls this directly
Tested by
no test coverage detected